JSON file from S3 to snowflake failed. Here S3_STG_AREA_JSON is the staging area & STG_TABLE_NAME_JSON is staging table.
Statement executed :
COPY INTO STG_TABLE_NAME_JSON FROM @S3_STG_AREA_JSON FILE_FORMAT=(TYPE='json' STRIP_OUTER_ARRAY=true)
Error:
**Code: 100183 State: P0000 Message: Error parsing JSON: missing first byte in UTF-8 sequence**
I have tried
COPY INTO STG_TABLE_NAME_JSON FROM @S3_STG_AREA_JSON FILE_FORMAT=(TYPE='json' STRIP_OUTER_ARRAY=true SKIP_BYTE_ORDER_MARK = TRUE)
Got same issue as above.
Then tried
COPY INTO STG_TABLE_NAME_JSON FROM @S3_STG_AREA_JSON FILE_FORMAT=(TYPE='json' STRIP_OUTER_ARRAY=true IGNORE_UTF8_ERRORS = TRUE)
Load is completed. But now, the snowflake table has � (U+FFFD)
How to fix this issue ?