I'm working with Snowflake and some JSON files that I need to upload into a Staging area. Since Snowflake doesn't allow files whose size is bigger than 1GB, I had to split them into smaller files using 7zip.
I ended up with 4 files like the ones below
Files were uploaded to the Staging area with a pattern as you can see in the attached image.
I'm trying to copy those files in the Staging area to another table by using following commands
copy into yelp_user from @staging/yelp_academic_dataset_user.json.gz file_format
=(format_name=yelp_user) on_error='skip_file';
Which gets me this error:
002019 (0A000): SQL compilation error:JSON file format can produce one and only one column of type variant or object or array. Use CSV file format if you want to load more than one column.
Then I tried creating a JSON table as:
CREATE OR REPLACE TABLE json_table_user(json_data variant);
copy into JSON_TABLE_USER file_format =(format_name = 'yelp_user') files=('yelp_academic_dataset_user.json.001.gz','yelp_academic_dataset_user.json.002.gz','yelp_academic_dataset_user.json.003.gz','yelp_academic_dataset_user.json.004.gz') on_error = 'skip_file';
And I get errors saying that
Remote file 'https://gcpuscentral1-ncxq405-stage.storage.googleapis.com/tables/2807681033/yelp_academic_dataset_user.json.004.gz' was not found. There are several potential causes. The file might not exist. The required credentials may be missing or invalid. If you are running a copy command, please make sure files are not deleted when they are being loaded or files are not being loaded into two different tables concurrently with auto purge option.
This is driving me crazy as following tutorials on Snowflake's website won't help me.
Does anyone knows how I can copy those split files into a table the way I need to?