Skip to content

Commit

Permalink
Fix for checksum lookup (#139)
Browse files Browse the repository at this point in the history
* Fix string interpolation
* Cast timestamp type
  • Loading branch information
ericaporter authored Apr 29, 2024
1 parent 3e078f9 commit a243b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dfe/analytics/services/postgres_checksum_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def build_select_and_order_clause(order_column, table_name_sanitized)
def build_where_clause(order_column, table_name_sanitized, checksum_calculated_at_sanitized)
return '' unless WHERE_CLAUSE_ORDER_COLUMNS.map(&:downcase).include?(order_column.downcase)

"WHERE DATE_TRUNC('milliseconds', #{table_name_sanitized}.#{order_column.downcase}) < DATE_TRUNC('milliseconds', '#{checksum_calculated_at_sanitized}')"
"WHERE DATE_TRUNC('milliseconds', #{table_name_sanitized}.#{order_column.downcase}) < DATE_TRUNC('milliseconds', #{checksum_calculated_at_sanitized}::timestamp)"
end
end
end
Expand Down

0 comments on commit a243b29

Please sign in to comment.