Skip to content

Conversation

@tdcmeehan
Copy link
Contributor

Description

When FilterScanRule transforms Exchange -> Filter -> TableScan to Filter -> Exchange -> TableScan, add a ProjectNode if the Filter's output variables don't match the original Exchange's expected output.

Motivation and Context

Fixes incorrect variable alignment when filters reference columns not in the final query output.

Impact

Fix some planner crashes for system tables with C++ functions.

Test Plan

Included unit tests, and added new end to end tests.

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 ==

When FilterScanRule transforms Exchange -> Filter -> TableScan to
Filter -> Exchange -> TableScan, add a ProjectNode if the Filter's
output variables don't match the original Exchange's expected output.
@tdcmeehan tdcmeehan requested a review from aaneja August 18, 2025 20:44
@tdcmeehan tdcmeehan requested review from a team as code owners August 18, 2025 20:44
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Aug 18, 2025
@prestodb-ci prestodb-ci requested review from a team and jkhaliqi and removed request for a team August 18, 2025 20:44
@tdcmeehan tdcmeehan merged commit ff042d8 into prestodb:master Aug 20, 2025
98 of 99 checks passed
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.

4 participants