Copy into snowflake saving file as octet-strea,

Viewed 91

have a query here. The goal is to send data from Snowflake to Azure Storageblob using a COPY INTO command. COPY INTO @AZURE_ML_STAGE FROM ( SELECT * FROM "DB"."SCHEMA"."DATA" WHERE _FIVETRAN_DELETED = FALSE ) FILE_FORMAT=(TYPE=csv)

Inspite of mentioning FILE_FORMAT=(TYPE=csv) the data in our Azure storage blob is saved as octet-stream and the file has no .csv extension. What could we be possibly doing wrong? Any leads would be helpful. Thanks in advance.

1 Answers

From doc: TYPE = CSV

If the SINGLE copy option is TRUE, then the COPY command unloads a file without a file extension by default. To specify a file extension, provide a file name and extension in the internal_location or external_location path. For example:

copy into @stage/data.csv ...

Default: null, meaning the file extension is determined by the format type, e.g. .csv[compression], where compression is the extension added by the compression method, if COMPRESSION is set.

And:

COPY INTO @AZURE_ML_STAGE/output.csv
FROM ( SELECT * FROM "DB"."SCHEMA"."DATA" 
       WHERE _FIVETRAN_DELETED = FALSE ) 
FILE_FORMAT=(TYPE=csv)
COMPRESSION = NONE
SINGLE = TRUE;
Related