Closed pankajkoti closed 10 months ago
The transformed COPY INTO command executed is like the below when metadata_columns are specified:
'COPY INTO <TABLE_NAME> FROM (SELECT $1,$2,METADATA$FILENAME,METADATA$FILE_ROW_NUMBER,METADATA$FILE_CONTENT_KEY,METADATA$FILE_LAST_MODIFIED,METADATA$START_SCAN_TIME FROM @SANDBOX.<schema_name>.<stage_name>/sample.csv) '
Sample load output with metadata columns
Patch coverage: 100.00%
and project coverage change: +0.73%
:tada:
Comparison is base (
4176abf
) 89.54% compared to head (09d2b10
) 90.28%. Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Nice! Thank you!
Adds support to load metadata columns like METADATA$FILENAME, METADATA$FILE_ROW_NUMBER, etc. from stage into target table while natively loading files into Snowflake tables. Read more at: https://docs.snowflake.com/en/user-guide/querying-metadata#example-3-loading-metadata-columns-into-a-table
Note that, you cannot specify both
validation_mode
andmetadata_columns
together in the Snowflake load options because when we need to loadmetadata_columns
, we need to explicitly name the metadata columns in theCOPY INTO
sql statement and such a transformed SQL statement does not allow specifyingVALIDATION_MODE
with it. It's a limitation for Snowflake queries. The transformed SQL appears like in the snippet in the following link: https://docs.snowflake.com/en/user-guide/querying-metadata#example-3-loading-metadata-columns-into-a-tablecloses: #1982