forked from apache/datafusion
-
Notifications
You must be signed in to change notification settings - Fork 2
pushdown for nested expressions #51
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
adriangb
wants to merge
32
commits into
main
Choose a base branch
from
push-changes-forward
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
459ef94
initial implementation of projection pushdown for nexted expressions
adriangb 9ed3fe8
fix lints, test
adriangb 8848e15
remove unused classes
adriangb 2920962
remove more functions
adriangb f5b0401
add test, start working on getting it passing
adriangb c8e3e32
test passing
adriangb 0271078
fix
adriangb a69a647
attempt to split projections
adriangb a63c40a
clippy
adriangb ade69dd
fix: only push projections through operators when beneficial
adriangb a154720
fix bug, update slt
adriangb 92cf4e6
fmt
adriangb cce8e13
try to fix
adriangb 75cb7e6
use triviality enum
adriangb 8722d33
revert unchanged files
adriangb 4145bd9
complete(ish) refactor
adriangb 6c88e5a
some fixes before next refactor
adriangb 93edb37
wip many failing tests
adriangb 073b511
working again
adriangb c64b74f
working again
adriangb 3877398
implement new ideas
adriangb 010a18b
lint
adriangb b4ba2b5
Fix get_field triviality to allow TrivialExpr base
adriangb a904387
fix doc
adriangb 6b0dfd4
fix docs
adriangb fd38d4c
Address Copilot review comments
adriangb 876f3f9
fix docs
adriangb ed04529
Fix literal projection pushdown through TopK operators
adriangb 42fc36b
Add projection_pushdown.slt test suite for get_field expressions
adriangb 61ceeb5
fix doc again
adriangb f995d9c
improve coverage
adriangb 3a8acbe
don't push widening through sort
adriangb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| //! Triviality classification for expressions and function arguments. | ||
|
|
||
| /// Classification of argument triviality for scalar functions. | ||
| /// | ||
| /// This enum is used by [`ScalarUDFImpl::triviality_with_args`] to allow | ||
| /// functions to make context-dependent decisions about whether they are | ||
| /// trivial based on the nature of their arguments. | ||
| /// | ||
| /// For example, `get_field(struct_col, 'field_name')` is trivial (static field | ||
| /// lookup), but `get_field(struct_col, key_col)` is not (dynamic per-row lookup). | ||
| /// | ||
| /// [`ScalarUDFImpl::triviality_with_args`]: crate::ScalarUDFImpl::triviality_with_args | ||
| #[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
| pub enum ArgTriviality { | ||
| /// Argument is a literal constant value or an expression that can be | ||
| /// evaluated to a constant at planning time. | ||
| Literal, | ||
| /// Argument is a simple column reference. | ||
| Column, | ||
| /// Argument is a complex expressions that declares itself trivial. | ||
| /// For example, if `get_field(struct_col, 'field_name')` is implemented as a | ||
| /// trivial expression, then it would return this variant. | ||
| /// Then `other_trivial_function(get_field(...), 42)` could also be classified as | ||
| /// a trivial expression using the knowledge that `get_field(...)` is trivial. | ||
| TrivialExpr, | ||
| /// Argument is a complex expression that declares itself non-trivial. | ||
| /// For example, `min(col1 + col2)` is non-trivial because it requires per-row computation. | ||
| NonTrivial, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.