Skip to content

feat(query): support cascading hierarchical grouping sets - #20249

Draft
forsaken628 wants to merge 5 commits into
databendlabs:mainfrom
forsaken628:rollup
Draft

feat(query): support cascading hierarchical grouping sets#20249
forsaken628 wants to merge 5 commits into
databendlabs:mainfrom
forsaken628:rollup

Conversation

@forsaken628

@forsaken628 forsaken628 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • add the opt-in enable_cascading_grouping_sets setting to derive each ROLLUP level from its closest strict superset, while keeping the existing shared-base strategy as the default
  • preserve distributed execution for scalar Materialized CTE producers by inserting a constant-key GlobalHash exchange after physical optimization
  • move Materialized CTE distribution normalization into a dedicated post-Cascades optimizer, keeping it independent of the grouping-sets rule and Cascades search
  • preserve GROUP BY () semantics for empty input instead of converting the scalar aggregate into a keyed aggregate

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

AI assistance

  • AI usage: An AI coding agent assisted with implementation.
  • Responsible human: @forsaken628
  • The responsible human has read every line of this diff and can explain each change

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label Aug 4, 2026
@forsaken628 forsaken628 added the ci-cloud Build docker image for cloud test label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-20249-af0717b-1785830025

note: this image tag is only available for internal use.

@forsaken628 forsaken628 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-20249-3e4d698-1785913488

note: this image tag is only available for internal use.

@forsaken628 forsaken628 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-20249-2fabfce-1786068419

note: this image tag is only available for internal use.

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

Labels

ci-cloud Build docker image for cloud test pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant