0

I am unloading snowflake data into external AWS S3 stg using the below command,

copy into '@ext_stg/path/file_name' 
from schema.table
file_format = (type=csv  field_delimiter= '~' compression='gzip' null_if=('','NULL', 'null',' ') field_optionally_enclosed_by= '"' )
OVERWRITE = TRUE
; 

I want the unloaded filename to be file_name.csv.gz.

But what I am actually getting from the above code is, file_name_0_3_0.csv.gz

How do i set the desired filename as file_name.csv.gz

2 Answers2

0

setting SINGLE=TRUE MAX_FILE_SIZE=5000000000 gave me the desired output. Thank you @waldente

Dharman
  • 30,962
  • 25
  • 85
  • 135
-1

Looks like you are trying to specify the csv extension twice. Try removing it from the S3 path, because the file extension is already specified in file_format.

copy into '@ext_stg/path/file_name.csv'

from schema.table

file_format = (type=csv field_delimiter= '~' compression='gzip' null_if=('','NULL', 'null',' ') field_optionally_enclosed_by= '"' )

OVERWRITE = TRUE ;