Below copy into creates file in s3 with filename data_17658djhgu167658.csv Need input on naming files with specific contractid.csv when unloading data to s3.TIA
COPY INTO @DEV_TEST/TEST_AMOUNT/LOANS/2024/11/Q4_2024_TEST/
FROM (
SELECT
*
FROM DEV.TEST_DATA )
PARTITION BY ('contractid' || ContractID)
FILE_FORMAT=(
TYPE = CSV
ESCAPE = NONE
ESCAPE_UNENCLOSED_FIELD = NONE
COMPRESSION = NONE
NULL_IF='NULL'
)
HEADER = TRUE
MAX_FILE_SIZE = 5000000000
;```
Below copy into creates file in s3 with filename data_17658djhgu167658.csv Need input on naming files with specific contractid.csv when unloading data to s3.TIA
COPY INTO @DEV_TEST/TEST_AMOUNT/LOANS/2024/11/Q4_2024_TEST/
FROM (
SELECT
*
FROM DEV.TEST_DATA )
PARTITION BY ('contractid' || ContractID)
FILE_FORMAT=(
TYPE = CSV
ESCAPE = NONE
ESCAPE_UNENCLOSED_FIELD = NONE
COMPRESSION = NONE
NULL_IF='NULL'
)
HEADER = TRUE
MAX_FILE_SIZE = 5000000000
;```
There is the parameter "Single=True" that would remove the UUID part from the file that is being unloaded to S3 using the "copy into" command. https://docs.snowflake/en/sql-reference/sql/copy-into-location
but for the custom filename, I think you will need a Stored Proc to achieve that during the file unload operation.