How to solve error "Field delimiter ',' found while expecting record delimiter '\n'" while loading json data to the stage

Viewed 806

I am trying to "COPY INTO" command to load data from s3 to the snowflake

Below are the steps I followed to create the stage and loading file from stage to Snowflake

JSON file

{
   "Name":"Umesh",
   "Desigantion":"Product Manager",
   "Location":"United Kingdom"
}
create or replace stage emp_json_stage
url='s3://mybucket/emp.json'
credentials=(aws_key_id='my id' aws_secret_key='my key');

# create the table with variant
CREATE TABLE emp_json_raw (
  json_data_raw VARIANT
);

#load data from stage to snowflake

COPY INTO emp_json_raw from @emp_json_stage;

I am getting below error

Field delimiter ',' found while expecting record delimiter '\n' File 'emp.json', line 2, character 18 Row 2, column "emp_json_raw"["JSON_DATA_RAW":1]

I am using a simple JSON file, and I don't understand this error.

What causes it and how can I solve it?

3 Answers
Related