Skip to content

Commit 91da647

Browse files
authored
fix: Use correct timezones for delete query for Snowflake Destination (#14097)
#### Summary It seems by default Snowflake uses `America/Pacific` timezone or the current session timezone (if it was overridden via the connection string) when using the `timestamp_tz` by switching to `timestamp_ntz` all timestamps will be in UTC
1 parent 424e4f3 commit 91da647

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/destination/snowflake/client/deletestale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (c *Client) DeleteStale(ctx context.Context, msgs message.WriteDeleteStales
1818
sb.WriteString(`"` + strings.ToUpper(schema.CqSourceNameColumn.Name) + `"`)
1919
sb.WriteString(" = ? and \"")
2020
sb.WriteString(strings.ToUpper(schema.CqSyncTimeColumn.Name))
21-
sb.WriteString("\"::timestamp_tz < ?::timestamp_tz")
21+
sb.WriteString("\"::timestamp_ntz < ?::timestamp_ntz")
2222
sql := sb.String()
2323
if _, err := c.db.ExecContext(ctx, sql, msg.SourceName, msg.SyncTime); err != nil {
2424
return err

0 commit comments

Comments
 (0)