Skip to content

Commit

Permalink
Snowflake: use sysdate() for peerdb synced at (#1769)
Browse files Browse the repository at this point in the history
CURRENT_TIMESTAMP returns timestamp in local timezone which can be
misleading when inspecting `peerdb_synced_at` values on Snowflake.
SYSDATE() gives it in UTC

https://docs.snowflake.com/en/sql-reference/functions/sysdate
  • Loading branch information
Amogh-Bharadwaj authored May 29, 2024
1 parent f97f78b commit b40f557
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flow/connectors/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func generateCreateTableSQLForNormalizedTable(
// this is a timestamp column that is used to mark records as synced
// default value is the current timestamp (snowflake)
if syncedAtColName != "" {
createTableSQLArray = append(createTableSQLArray, syncedAtColName+" TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
createTableSQLArray = append(createTableSQLArray, syncedAtColName+" TIMESTAMP DEFAULT SYSDATE()")
}

// add composite primary key to the table
Expand Down

0 comments on commit b40f557

Please sign in to comment.