Repository navigation
Fix Yardstick live replay and measure context parity - #495
Conversation
b6fbcf0 to
72bc674
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72bc67433e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not column.table | ||
| and column.name.lower() in measure_aliases | ||
| and column.name.lower() not in known_columns |
There was a problem hiding this comment.
Preserve physical-column precedence for wildcard imports
For a Yardstick view declared with SELECT *, the adapter does not populate model.dimensions with the physical columns, so known_columns cannot establish that a name is absent from the source. For example, with physical years 2022 and 2023, SELECT AGGREGATE(tally) AS year, year + 1 AS next_year FROM sales_v should bind the second year to the physical column and infer that grouping grain. This expansion instead substitutes the measure expression, eliminating the grouping and returning the total count plus one. Avoid expanding potentially shadowed aliases when the wildcard source's column names are unknown.
Useful? React with 👍 / 👎.
| filters.push(( | ||
| self.replace_current(predicate, &bindings)?, | ||
| HashSet::new(), | ||
| position, |
There was a problem hiding this comment.
Keep CURRENT bindings opaque until filter projection finishes
In the Rust engine, SELECT o.year, AGGREGATE(revenue) AT (WHERE year = CURRENT year SET year = 2022) FROM orders_v o GROUP BY o.year fails with a mixed-predicate binding error instead of replacing the year constraint. Resolving the CURRENT placeholder here stores _inner.year = o.year in the filter; the subsequent SET marks year for removal, and project_at_filter treats o.year as an independent retained dependency. The Python implementation preserves CURRENT bindings separately and correctly discards this replaced constraint. Preserve that distinction in Rust until dimension-dependent filters have been projected.
Useful? React with 👍 / 👎.
Replay portable measures from Yardstick’s table-backed definition-store fixture and check their results against the upstream expected rows. The replay checks the fixture fingerprint so changes to its native storage and session cases require explicit review.
The Python and Rust rewriters handle projection aliases, GROUP BY ALL, grouping sets, and AT modifiers over joined inputs. Regression cases cover subtotal grains and the effect of visible join rows on measure context.
The live definition and SQL replay checks pass against Yardstick revision 2b131840. The changes apply to the renamed sqlctx packages on current main.