upload json into a snowflake table

I created an empty table in Snowflake.

enter image description here

I want to upload a json file into this table now. One possibility would be to add the entire json’s value into the first row of the first column. However, when I upload the file from my computer, and select JSON as the type, I get this error

Unable to copy files into table.
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.

What am I doing wrong? Am I supposed to use another file type instead?

>Solution :

Your column type is VARCHAR, as the error suggests, it needs to be of type variant or object or array if you want to load everything into one column from the JSON file.

Leave a Reply