Skip to content

Fix Yardstick live replay and measure context parity - #495

Merged
nicosuave merged 7 commits into
mainfrom
codex/yardstick-live-replay-parity
Nov 26, 2026
Merged

nicosuave merged 7 commits into
mainfrom
codex/yardstick-live-replay-parity

Conversation

@nicosuave

@nicosuave nicosuave commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

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.

@nicosuave
nicosuave added this pull request to stack #504 November 25, 2026 02:00
@nicosuave nicosuave changed the title Separate native Yardstick fixtures and fix GROUP BY ALL parity Fix Yardstick live replay and measure context parity Nov 25, 2026
@nicosuave
nicosuave marked this pull request as ready for review November 26, 2026 17:29
@nicosuave
nicosuave force-pushed the codex/yardstick-live-replay-parity branch from b6fbcf0 to 72bc674 Compare November 26, 2026 17:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T17:31:48.425415Z 72bc674 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sqlctx/sql/query_rewriter.py Outdated
Comment on lines +3712 to +3714
if not column.table
and column.name.lower() in measure_aliases
and column.name.lower() not in known_columns

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread sqlctx-rs/src/sql/rewriter/yardstick.rs Outdated
Comment on lines +1115 to +1118
filters.push((
self.replace_current(predicate, &bindings)?,
HashSet::new(),
position,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@nicosuave
nicosuave merged commit c573ecf into main Nov 26, 2026
31 checks passed
@nicosuave
nicosuave deleted the codex/yardstick-live-replay-parity branch November 26, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant