I have some tables that I would like to export the results of into a internal (or external) stage of snowflake. The problem is Snowflake throws an error.
COPY INTO @test_stage/test_file.csv.gz FROM (
SELECT *
FROM database.shema.table)
file_format = (type = 'CSV'
field_delimiter = '|'
compression = 'gzip'
null_if = ()
field_optionally_enclosed_by = None)
HEADER = True
OVERWRITE = True
MAX_FILE_SIZE = 4900000000
SINGLE = True;
Cannot unload empty string without file format option field_optionally_enclosed_by being specified.
If I do not specify the field_optionally_enclosed_by I will get that error.
If I set it field_optionall_enclosed_by to None I get that error (none is default).
If I set it to a quote or double quote it’s fine but I do not want strings quoted. I want empty values like this:
2020-05-10|||
Not this:
2020-05-10|""|""|