Render simple-metric inputs without a dunder prefix for the WHERE filter#1941
Merged
Render simple-metric inputs without a dunder prefix for the WHERE filter#1941
WHERE filter#1941Conversation
355527a to
75cc786
Compare
75cc786 to
9741731
Compare
WilliamDee
approved these changes
Nov 20, 2025
| SELECT | ||
| metric_time__day | ||
| , SUM(__visits) AS __visits | ||
| , SUM(visits) AS __visits |
Contributor
There was a problem hiding this comment.
This works but it's definitely going to look confusing to users. I think we can release as-is but I wonder if we can improve this by rendering only the non-dundered name anytime after the initial source node. But @plypaul maybe you already looked into that and it didn't work?
plypaul
added a commit
that referenced
this pull request
Dec 2, 2025
This PR is an update to #1941 to handle an edge case with manifests that contain a metric and an entity with the same name. Instead of aliasing all simple-metrics, the change is to alias only a specific one that is relevant to the containing branch in the dataflow plan. This limits collisions in the `SELECT` statement that is generated from the branch. Due to the large snapshot changes, please view by commit.
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.
This PR updates the SQL rendering for the
WhereConstraintNodeto use a subquery that generates column aliases without a dunder prefix for simple metric inputs e.g. (bookingsinstead of__bookings).This is added to handle a migration case - some customers have been writing SQL strings in the filters that reference internal column names, which is an unsupported use case. However, to reduce errors during migration, this PR temporarily restores the previous behavior.
Due to the snapshot changes, please view by commit.