dbt-labs / dbt-external-tables

dbt macros to stage external sources
https://hub.getdbt.com/dbt-labs/dbt_external_tables/latest/
Apache License 2.0
286 stars 115 forks source link

Snowflake Snowpipe: `_dbt_copied_at` field should use `metadata$start_scan_time` instead of current timestamp #281

Closed dataders closed 2 months ago

dataders commented 2 months ago

I suggest replacing the current _dbt_copied_at field which uses current_timestamp since Snowflake recommends against using that function in a Snowpipe.

https://community.snowflake.com/s/article/Incorrect-timestamp-in-Snowpipe-while-using-current-timestampfunction

https://docs.snowflake.com/en/user-guide/data-load-snowpipe-ts#load-times-inserted-using-current-timestamp-earlier-than-load-time-values-in-copy-history-view

Originally posted by @jtmcn in https://github.com/dbt-labs/dbt-external-tables/issues/239#issuecomment-1889956737

dataders commented 2 months ago

resolved by #282