Closed taskooh closed 6 months ago
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.
The snowflake documentation does not recommend using SYSDATE/CURRENT_TIMESTAMP in Snowpipe. i am using METADATA$START_SCAN_TIME
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.
Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers.
We're also encounter this issue, we then modify system timezone to 'UTC' to address... Agree on @yingyingqiqi 's reply https://github.com/dbt-labs/dbt-external-tables/pull/186#issuecomment-1680289740 to get more accurate timestamp, but as per snowflake document METADATA$START_SCAN_TIME data type is also TIMESTAMP_LTZ. convert to TIMESTAMP (TIMESTAMP_NTZ) would still cause problem like origin post.
Description & motivation
Now it is using
current_timestamp::timestamp
function to get current timestamp, but this is wrong because type of current_timestamp is TIMESTAMP_LTZ(local time zone) and when converted to timestamp_ntz(no time zone) by::timestamp
timezone is forcibly removed and showing wrong timestamp. We should usesysdate()
instead. https://docs.snowflake.com/en/sql-reference/functions/sysdate.htmlHow i checked:
Look at dbt log and generated raw sql. Run that sql with this update manually on snowflake, and check that timezone issue is fixed.
Checklist