Skip to content

feat(cubesql): SQL push down multiple window expressions with different sort keys #8788

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 1 commit into from
Apr 30, 2025

Conversation

MazterQyou
Copy link
Member

Check List

  • Tests has 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

This PR adds SQL push down support for multiple window expressions with different sort keys. In cases where there are several window function expressions in a SELECT and they ORDER BY different keys, DataFusion generates several WindowAggr nodes on top of each other, with window expressions grouped by sort keys. Joining them together is invalid in terms of DataFusion logical plan, but having them together in a wrapped select is fine. Related test is added.

@MazterQyou MazterQyou requested a review from a team as a code owner October 4, 2024 21:12
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 91.95980% with 16 lines in your changes missing coverage. Please review.

Project coverage is 80.30%. Comparing base (044341e) to head (bafcf72).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ubesql/src/compile/rewrite/rules/wrapper/window.rs 90.47% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #8788       +/-   ##
===========================================
+ Coverage   57.50%   80.30%   +22.79%     
===========================================
  Files         165      395      +230     
  Lines       13504    97508    +84004     
  Branches     2278     2278               
===========================================
+ Hits         7766    78302    +70536     
- Misses       5430    18898    +13468     
  Partials      308      308               
Flag Coverage Δ
cube-backend 57.50% <ø> (ø)
cubesql 83.96% <91.95%> (?)

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.

@MazterQyou MazterQyou force-pushed the cubesql/window-aggr-double-sql-push-down branch from 9261d21 to bafcf72 Compare April 30, 2025 16:08
@MazterQyou MazterQyou merged commit 2b1bb28 into master Apr 30, 2025
81 checks passed
@MazterQyou MazterQyou deleted the cubesql/window-aggr-double-sql-push-down branch April 30, 2025 17:26
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