Skip to content

Simplify RowNumber and TopNRowNumber node with empty input#21914

Merged
feilong-liu merged 1 commit intoprestodb:masterfrom
feilong-liu:fix_empty
Feb 15, 2024
Merged

Simplify RowNumber and TopNRowNumber node with empty input#21914
feilong-liu merged 1 commit intoprestodb:masterfrom
feilong-liu:fix_empty

Conversation

@feilong-liu
Copy link
Contributor

Description

We have an optimizer SimplifyPlanWithEmptyInput which simplify query plans with empty values input. However, it does not cover RowNumber and TopNRowNumber node. In this PR, I include them so that it will also be optimized.

Motivation and Context

Simplify query plan with RowNumber and TopNRowNumber with empty input.

Impact

Improve performance.

Test Plan

Unit tests

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Add optimization for query plans which contains RowNumber and TopNRowNumber nodes with empty input

Copy link
Contributor

@kaikalur kaikalur left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@pranjalssh pranjalssh left a comment

Choose a reason for hiding this comment

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

LGTM

@feilong-liu feilong-liu force-pushed the fix_empty branch 3 times, most recently from 7be2b8e to 75d7eb9 Compare February 15, 2024 06:07
@feilong-liu feilong-liu merged commit b4e837d into prestodb:master Feb 15, 2024
@feilong-liu feilong-liu deleted the fix_empty branch February 15, 2024 20:14
@wanglinsong wanglinsong mentioned this pull request May 1, 2024
48 tasks
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.

4 participants