Skip to content

feat(cubesql): Support trivial casts in member pushdown #9480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 28, 2025

Conversation

mcheshkov
Copy link
Contributor

Check List

  • Tests have been run in packages where changes 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 (if issue reference is not provided)

This should allow pushing down expressions like CAST(dimension AS TEXT) AS alias into CubeScan as regular dimensions.
This should allow __cubeJoinField joins to see more CubeScans

Supporting changes:

Remove unused rule for member pushdown from AllMembers
All matching happening with CubeScanMembers on top of actual members node, and this rule does not expect that
member_name_to_expr part of analysis can extract members from CubeScanMembers(AllMembers), so there's no reason to keep this rule

Add explicit type in var! macro, to avoid type confusion.

@mcheshkov mcheshkov force-pushed the member-pushdown-cast branch from 28db177 to a7c10cd Compare April 16, 2025 13:29
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

Attention: Patch coverage is 98.38710% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.31%. Comparing base (39ff5e9) to head (1312aba).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...besql/cubesql/src/compile/rewrite/rules/members.rs 97.43% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9480      +/-   ##
==========================================
- Coverage   83.87%   80.31%   -3.56%     
==========================================
  Files         230      395     +165     
  Lines       83825    97349   +13524     
  Branches        0     2278    +2278     
==========================================
+ Hits        70305    78185    +7880     
- Misses      13520    18856    +5336     
- Partials        0      308     +308     
Flag Coverage Δ
cube-backend 57.50% <ø> (?)
cubesql 83.98% <98.38%> (+0.11%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@mcheshkov mcheshkov marked this pull request as ready for review April 16, 2025 14:06
@mcheshkov mcheshkov requested a review from a team as a code owner April 16, 2025 14:06
…bers

All matching happening with CubeScanMembers on top of actual members node, and this rule does not expect that
member_name_to_expr part of analysis can extract members from CubeScanMembers(AllMembers), so there's no reason to keep this rule
@mcheshkov mcheshkov force-pushed the member-pushdown-cast branch from a7c10cd to 1312aba Compare April 28, 2025 12:26
@mcheshkov mcheshkov merged commit 85c27a9 into master Apr 28, 2025
72 checks passed
@mcheshkov mcheshkov deleted the member-pushdown-cast branch April 28, 2025 13:15
marianore-muttdata pushed a commit to MuttData/cube that referenced this pull request Jun 17, 2025
This should allow pushing down expressions like `CAST(dimension AS TEXT) AS alias` into `CubeScan` as regular dimensions.
And that, in turn, should allow `__cubeJoinField` joins to see more `CubeScan`s

Supporting changes:

Remove unused rule for member pushdown from `AllMembers`
All matching happening with `CubeScanMembers` on top of actual members node, and this rule does not expect that
`member_name_to_expr` part of analysis can extract members from `CubeScanMembers(AllMembers)`, so there's no reason to keep this rule

Add explicit type in `var!` macro, to avoid type confusion.
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.

2 participants