Skip to content

Add additional runs of columnPruningRules and WindowFilterPushDown #25176

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xin-zhang2
Copy link
Contributor

@xin-zhang2 xin-zhang2 commented May 22, 2025

Description

  1. SimplifyPlanWithEmptyInput might bring in new ProjectNodes. An additional run of columnPruningRules can be applied in case the child of the project is eligible for rewriting.
  2. If the child is a WindowNode, an additional run of WindowFilterPushdown can be applied in case it can be replaced with RowNumber.
  3. Also removed a redundant check in visitWindow of WindowFilterPushdown. The check is already performed in canOptimizeWindowFunction, and if the node doesn't meet the optimization criteria, the optimzation should be skipped rather than throwing an error.

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • 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.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label May 22, 2025
@xin-zhang2 xin-zhang2 force-pushed the optimizer_tweaks branch 2 times, most recently from cb26e1e to c7802a5 Compare May 26, 2025 14:13
@xin-zhang2 xin-zhang2 changed the title Change the order of WindowFilterPushDown rule Add additional runs of columnPruningRules and WindowFilterPushDown May 27, 2025
@xin-zhang2 xin-zhang2 marked this pull request as ready for review May 27, 2025 10:10
@xin-zhang2 xin-zhang2 requested a review from a team as a code owner May 27, 2025 10:10
@xin-zhang2 xin-zhang2 requested a review from hantangwangd May 27, 2025 10:10
@prestodb-ci prestodb-ci requested review from a team, Joe-Abraham and Mariamalmesfer and removed request for a team May 27, 2025 10:10
Copy link
Contributor

@mohsaka mohsaka left a comment

Choose a reason for hiding this comment

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

Looks good to me. Seems like the only difference is an ordering change on the inner joins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants