0
votes

I got this link from snowflake site "https://youtu.be/H0sbMDqdYQ8" ,were they are trying load from json file with copy command ,where the table has 4 column of the 2 are variant.i am trying the same ,but when try load the json file with copy command with file format as JSON ,its throws error "SQL compilation error: JSON/XML/AVRO 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." how to load a json file into a table which has more than one column.my requirement is same as the above youtube link ...

1
The video doesn't specify the file format that is being used. Have you tried doing what the error message tells you to do? If a file is multiple columns of JSON data, then it must be contained as a CSV file. You are using a JSON format in your copy command.Mike Walton
Since in the video he has shown the JSON file and its not a CSV file.That where i got a doubt how he is loading JSON file into muliple columns of a table.Lesly Premsingh C
Hi All, Got the below example from snowflake site "docs.snowflake.com/en/user-guide/data-load-transform.html" under the section "Load semi-structured Data into Separate Columns" and able to load multiple column of a table.Lesly Premsingh C

1 Answers

1
votes

In the example from Snowflake's docs, data-load-transform check out the section Load semi-structured Data into Separate Columns and you'll be able to load multiple columns of a table.