Skip to content

Commit

Permalink
add line number to sorting to make it deterministic (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriemerrell authored Nov 28, 2023
1 parent ddc03da commit 2c84433
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ int_payments__refunds AS (
FROM refunds_union
-- this dedupes on coalesced_id (which is comprised of retrieval_reference_number or aggregation_id if it is null) and refund_amount
-- because we observe some duplicate refunds by retrieval_reference_number/aggregation_id and refund_amount
QUALIFY ROW_NUMBER() OVER (PARTITION BY coalesced_id, refund_amount ORDER BY littlepay_export_ts DESC) = 1
-- add line number to sorting to make this deterministic
QUALIFY ROW_NUMBER() OVER (PARTITION BY coalesced_id, refund_amount ORDER BY littlepay_export_ts DESC, _line_number DESC) = 1

)

Expand Down

0 comments on commit 2c84433

Please sign in to comment.