From f627222ec9005b40b992d9285f21cd70fa5f23d3 Mon Sep 17 00:00:00 2001 From: Joel McNierney Date: Wed, 10 Apr 2024 16:10:39 -0700 Subject: [PATCH] use metadata for _dbt_copied_at in Snowpipe --- macros/plugins/snowflake/snowpipe/get_copy_sql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/plugins/snowflake/snowpipe/get_copy_sql.sql b/macros/plugins/snowflake/snowpipe/get_copy_sql.sql index 8a52834..066840e 100644 --- a/macros/plugins/snowflake/snowpipe/get_copy_sql.sql +++ b/macros/plugins/snowflake/snowpipe/get_copy_sql.sql @@ -26,7 +26,7 @@ metadata$filename::varchar as metadata_filename, metadata$file_row_number::bigint as metadata_file_row_number, metadata$file_last_modified::timestamp as metadata_file_last_modified, - current_timestamp::timestamp as _dbt_copied_at + metadata$start_scan_time::timestamp as _dbt_copied_at from {{external.location}} {# stage #} ) file_format = {{external.file_format}}