-
Notifications
You must be signed in to change notification settings - Fork 2.2k
refactor: make join projection pushdown schema-aware via ColumnIndex/… #23185
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
Phoenix500526
wants to merge
6
commits into
apache:main
Choose a base branch
from
Phoenix500526:refactor/23010
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 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dca264a
refactor: make join projection pushdown schema-aware via ColumnIndex/…
Phoenix500526 03fc98a
refactor: make try_pushdown_through_join pub(crate)
Phoenix500526 5bfbeba
refactor: avoid public join column API
Phoenix500526 a62b5c6
refactor(physical-plan): preserve join pushdown API
Phoenix500526 e9db144
refactor(join): consolidate projection pushdown
Phoenix500526 1ff782e
refactor(join): deprecate positional pushdown
Phoenix500526 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
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 |
|---|---|---|
|
|
@@ -885,6 +885,11 @@ impl HashJoinExec { | |
| true | ||
| } | ||
|
|
||
| /// column indices | ||
| pub fn column_indices(&self) -> &Vec<ColumnIndex> { | ||
| &self.column_indices | ||
| } | ||
|
|
||
| /// left (build) side which gets hashed | ||
| pub fn left(&self) -> &Arc<dyn ExecutionPlan> { | ||
| &self.left | ||
|
|
@@ -1557,23 +1562,21 @@ impl ExecutionPlan for HashJoinExec { | |
| return Ok(None); | ||
| } | ||
|
|
||
| // TODO: split by `col`/`JoinSide` instead so mark joins can also push down to children. | ||
| let schema = self.schema(); | ||
| if !matches!(self.join_type(), JoinType::LeftMark | JoinType::RightMark) | ||
| && let Some(JoinData { | ||
| projected_left_child, | ||
| projected_right_child, | ||
| join_filter, | ||
| join_on, | ||
| }) = try_pushdown_through_join( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need try_pushdown_through_join after this PR? Perhaps we should remove it (or migrate other sites over that still use it)? |
||
| projection, | ||
| self.left(), | ||
| self.right(), | ||
| self.on(), | ||
| &schema, | ||
| self.filter(), | ||
| )? | ||
| { | ||
| if let Some(JoinData { | ||
| projected_left_child, | ||
| projected_right_child, | ||
| join_filter, | ||
| join_on, | ||
| }) = try_pushdown_through_join( | ||
| projection, | ||
| self.left(), | ||
| self.right(), | ||
| self.on(), | ||
| &schema, | ||
| self.filter(), | ||
| self.column_indices(), | ||
| )? { | ||
| self.builder() | ||
| .with_new_children(vec![ | ||
| Arc::new(projected_left_child), | ||
|
|
||
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
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.