Add Shopify ClickHouse template - #2467
Merged
Merged
Conversation
arsalann
marked this pull request as ready for review
July 28, 2026 15:23
Comment on lines
+181
to
+190
| WITH raw_lines AS ( | ||
| SELECT | ||
| o.id AS order_id, | ||
| o.updated_at AS order_updated_at, | ||
| item | ||
| FROM shopify.t1_orders AS o | ||
| ARRAY JOIN JSONExtractArrayRaw(ifNull(o.line_items, '[]')) AS item | ||
| WHERE o.updated_at BETWEEN | ||
| parseDateTime64BestEffort('{{ start_timestamp }}', 6, 'UTC') | ||
| AND parseDateTime64BestEffort('{{ end_timestamp }}', 6, 'UTC') |
Contributor
There was a problem hiding this comment.
Removed order lines remain stale
When an order edit removes a line item, raw_lines emits only the items still present in the updated payload, so the key-based merge never deletes the removed line. The stale row continues contributing to downstream product and revenue metrics and can fail the blocking order-header reconciliation checks.
Prompt To Fix With AI
This is a comment left during a code review.
Path: templates/shopify-clickhouse/assets/t2/t2_order_line_items.sql
Line: 181-190
Comment:
**Removed order lines remain stale**
When an order edit removes a line item, `raw_lines` emits only the items still present in the updated payload, so the key-based merge never deletes the removed line. The stale row continues contributing to downstream product and revenue metrics and can fail the blocking order-header reconciliation checks.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Contributor
Prompt To Fix All With AI### Issue 1
templates/shopify-clickhouse/assets/t2/t2_order_line_items.sql:181-190
**Removed order lines remain stale**
When an order edit removes a line item, `raw_lines` emits only the items still present in the updated payload, so the key-based merge never deletes the removed line. The stale row continues contributing to downstream product and revenue metrics and can fail the blocking order-header reconciliation checks.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Add Shopify ClickHouse template" | Re-trigger Greptile |
turtleDev
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bruin init shopify-clickhousewith a regression testValidation
make formatmake testnpm run docs:build