Skip to content

Prepare Yardstick for DuckDB 2.0 - #52

Merged
nicosuave merged 2 commits into
mainfrom
duckdb-2-release
Oct 21, 2026
Merged

nicosuave merged 2 commits into
mainfrom
duckdb-2-release

Conversation

@nicosuave

@nicosuave nicosuave commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Yardstick's previous 2.0 target followed a moving release branch and no longer compiled against the final engine. Pin the submodule and release CI to DuckDB 2.0.0 at d54cbbe3df17e8e5ce68312f483b4155836112aa, with matching pinned extension CI tooling, while retaining the legacy 1.5.5 job and advisory main canary.

Adapt parser construction, expression parsing, grammar transformer arena ownership, and parse-tree traversal to the final APIs. Preserve session grammar and parser settings during deferred binding, plus the caller's order_by_non_integer_literal binder setting on the wrapper's private execution connection. Replace scalar-context MAX wrappers with LIST_MAX(LIST(...)) to avoid DuckDB 2.0's LIST subquery binding failure while preserving deterministic maximum semantics when correlated values differ. This workaround buffers the candidate values. Update native suites for the removed parser toggle and add session-setting, correlated-context, and LIST regressions.

Validated locally on macOS ARM64 using checksum-verified official DuckDB release libraries:

  • DuckDB 2.0.0: 24 SQL suites, 3,971 assertions passed, including the combined grammar fixture.
  • DuckDB 1.5.5: all six legacy SQL suites, 2,857 assertions passed.
  • Optimized extension loaded in the official 2.0.0 CLI; SUM and LIST smoke queries passed.
  • Workflow YAML/JSON and diff checks passed. Other platforms await CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T14:27:45.862720Z d8a8d32 PR opened
ℹ️ 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: d8a8d32819

ℹ️ 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 src/frontend_peg.cpp
#if YARDSTICK_PARSER_INSTANCE_API
// GetParserOptions is private in 2.0. Snapshot the same public settings for
// deferred binding; NativeYardstickParseScope disables override recursion.
auto options = ParserOptions::Builtin();

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 all session parser settings

When a DuckDB 2.0 session enables another parser option such as order_by_non_integer_literal, this manually constructed snapshot leaves that option at ParserOptions::Builtin()'s default. Queries that go through yardstick(...) or deferred SELECT binding are therefore reparsed differently from the originating session and can be rejected even though the same SQL is accepted directly. Copy every context-dependent parser option here, including order_by_non_integer_literal, rather than only the five currently listed.

Useful? React with 👍 / 👎.

Comment thread yardstick-rs/src/sql/measures.rs Outdated
wrap_decorated_scalar_recomputation(&eval_sql)
} else {
format!("MAX({eval_sql})")
format!("ANY_VALUE({eval_sql})")

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 Avoid arbitrary collapse of correlated measure values

For an ungrouped non-decomposable measure whose AT (SET ...) expression depends on the outer row—for example, AGGREGATE(revenue) AT (SET year = year - 1) over several years—eval_sql can yield different values for different source rows even though original_dim_cols is empty. ANY_VALUE then chooses an arbitrary one, making the result scan-order dependent and changing the previous deterministic MAX behavior. The LIST compatibility fix should not use ANY_VALUE unless the generated values are proven identical; use a type-aware collapse or explicitly validate the single-value invariant.

Useful? React with 👍 / 👎.

@nicosuave
nicosuave merged commit f964e64 into main Oct 21, 2026
12 checks passed
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