Skip to content

[CALCITE-7697] Simplify window PARTITION BY and ORDER BY keys in RelBuilder - #5165

Merged
xuzifu666 merged 1 commit into
apache:mainfrom
xuzifu666:em_opt
Aug 12, 2026
Merged

[CALCITE-7697] Simplify window PARTITION BY and ORDER BY keys in RelBuilder#5165
xuzifu666 merged 1 commit into
apache:mainfrom
xuzifu666:em_opt

Conversation

@xuzifu666

Copy link
Copy Markdown
Member

* references fixed columns and is dropped, leaving {@code ORDER BY z}. */
private ImmutableList<RexFieldCollation> simplifySortKeys(
List<RexNode> partitionKeys, List<RexFieldCollation> sortKeys) {
// A RANGE frame with a value offset (e.g. RANGE BETWEEN 5 PRECEDING)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which test covers this case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out, I had added a test testProjectOverRangeOffsetKeepsSortKey to cover it. The new test would fail without the following modification.

@xuzifu666 xuzifu666 added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Aug 11, 2026
@xuzifu666 xuzifu666 changed the title [CALCITE-7696] Simplify window PARTITION BY and ORDER BY keys in RelBuilder [CALCITE-7697] Simplify window PARTITION BY and ORDER BY keys in RelBuilder Aug 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@xuzifu666
xuzifu666 merged commit c92f9e8 into apache:main Aug 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants