Skip to content

fix(cubesql): Resolve schema-qualified pg_catalog functions#11190

Open
MazterQyou wants to merge 1 commit into
masterfrom
cubesql/compound-function-fix
Open

fix(cubesql): Resolve schema-qualified pg_catalog functions#11190
MazterQyou wants to merge 1 commit into
masterfrom
cubesql/compound-function-fix

Conversation

@MazterQyou

Copy link
Copy Markdown
Member

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made

This PR bumps cube-js/arrow-datafusion@c7e6855, fixing a regression introduced with sqlparser bump where parsing pg_catalog.array_agg leads to parsing it as a compound function name. Related test is included.

@MazterQyou MazterQyou requested review from a team as code owners July 1, 2026 15:33
@github-actions github-actions Bot added the rust Pull requests that update Rust code label Jul 1, 2026
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @MazterQyou's task in 27s —— View job


Code Review

Review complete — LGTM, no blocking issues.
  • Read PR diff
  • Reviewed dep bump, test, and snapshot
  • Assessed risk/coverage

Summary

Targeted fix: bumps cube-js/arrow-datafusion to c7e6855, which restores parsing of compound (schema-qualified) function names like pg_catalog.array_agg that regressed with the recent sqlparser bump. Adds a snapshot-backed regression test.

Findings

  • rust/cubesql/cubesql/Cargo.toml:13 — dep pin looks fine; matches Cargo.lock updates on both sides (rust/cubesql/Cargo.lock, packages/cubejs-backend-native/Cargo.lock).
  • rust/cubesql/cubesql/src/compile/mod.rs:17279-17291 — the new test_pg_catalog_array_agg test is minimal but exactly targets the regression (schema-qualified aggregate in SELECT over VALUES). Snapshot at pg_catalog_array_agg.snap produces the expected {1,2,3} array literal.
  • No changes to production Rust code beyond the dep bump — the actual fix lives upstream in the datafusion fork, so surface area here is limited.

Suggestions (non-blocking)

  • Consider adding one more test covering a schema-qualified scalar (non-aggregate) function to lock down parity, e.g. pg_catalog.upper('x') or pg_catalog.pg_get_expr(...), since the underlying parser fix likely covers all compound identifiers, not just aggregates. Optional — the current test is sufficient to catch the specific regression.
  • No docs/API changes needed.

Verdict: LGTM. Straightforward upstream fix pull-through with an appropriate regression test.

• Branch: `cubesql/compound-function-fix`

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.26%. Comparing base (f9398ab) to head (a75400a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11190      +/-   ##
==========================================
- Coverage   83.70%   79.26%   -4.45%     
==========================================
  Files         257      474     +217     
  Lines       79465    97024   +17559     
  Branches        0     3572    +3572     
==========================================
+ Hits        66513    76902   +10389     
- Misses      12952    19606    +6654     
- Partials        0      516     +516     
Flag Coverage Δ
cube-backend 59.13% <ø> (?)
cubesql 83.70% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com>
@MazterQyou MazterQyou force-pushed the cubesql/compound-function-fix branch from 21293c8 to a75400a Compare July 3, 2026 13:31
@claude

claude Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @MazterQyou's task in 27s —— View job


Code Review

LGTM — no blocking issues. Already approved by @ovr.
  • Read PR diff
  • Reviewed dep bump, test, and snapshot
  • Assessed risk/coverage

Summary

Targeted fix: bumps cube-js/arrow-datafusion to c7e6855, restoring parsing of schema-qualified function names like pg_catalog.array_agg that regressed with the recent sqlparser bump. Adds a snapshot-backed regression test.

Findings

  • rust/cubesql/cubesql/Cargo.toml:13 — dep pin looks fine; matches Cargo.lock updates on both sides (rust/cubesql/Cargo.lock, packages/cubejs-backend-native/Cargo.lock).
  • rust/cubesql/cubesql/src/compile/mod.rs:17279-17291 — new test_pg_catalog_array_agg test is minimal and targets the regression precisely (schema-qualified aggregate in SELECT over VALUES). Snapshot at pg_catalog_array_agg.snap correctly asserts {1,2,3}.
  • No production Rust changes beyond the dep bump — actual fix lives upstream in the datafusion fork, so local surface area is limited.

Quality / Security / Perf

  • Code quality: clean, minimal, follows existing test conventions in mod.rs.
  • Security: no auth/input-handling surface touched; upstream sqlparser fix only affects identifier parsing.
  • Performance: no runtime paths altered.

Suggestions (non-blocking)

  • Consider adding one more test covering a schema-qualified scalar (non-aggregate) function to lock down parity, e.g. pg_catalog.upper('x'), since the underlying parser fix likely covers all compound identifiers, not just aggregates. Optional.
  • No docs/API changes needed.

Verdict: LGTM.

• Branch: `cubesql/compound-function-fix`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants