Commit d318324
authored
PushdownFilter optimizations (apache#21668)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Addresses apache#20002
- Includes apache#21643
- Looks like we had a similar idea with apache#21667, cc @kumarUjjawal
- [x] I like the name `try_unchecked` more so I would adopt that
- I'm not sure if we need to keep the unaliasing, the optimizer rule
already does that
- I have additional changes for more aggressive optimizations, so I'm
happy to combine the PRs or rebase after merge
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
## What changes are included in this PR?
- Add a hidden `Filter::new` constructor that skips type-checking
- Less allocations, more modification of mutable plan nodes
- Less cloning, use references when possible
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
Relying on existing tests mostly, added a few more tests.
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
`make_filter` is deprecated, probably wasn't meant to be a public
function.1 parent 0da8961 commit d318324
4 files changed
Lines changed: 306 additions & 335 deletions
File tree
- datafusion
- expr/src/logical_plan
- optimizer/src
- simplify_expressions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2495 | 2495 | | |
2496 | 2496 | | |
2497 | 2497 | | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
2498 | 2511 | | |
2499 | 2512 | | |
2500 | 2513 | | |
| |||
0 commit comments