-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix join column handling logic for On
and Using
constraints
#605
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c97e550
fix join column handling logic for `On` and `Using` constraints
houqp 702a5a0
handling join column expansion during USING JOIN planning
houqp c462206
Merge remote-tracking branch 'upstream/master' into qp_join
houqp ccbb844
add more comments & fix clippy
houqp 091bb75
add more comment
houqp e97b86a
reduce duplicate code in join predicate pushdown
houqp 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -36,4 +36,4 @@ group by | |
order by | ||
supp_nation, | ||
cust_nation, | ||
l_year; | ||
l_year; |
This file contains 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 |
---|---|---|
|
@@ -1277,6 +1277,96 @@ mod tests { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn left_join_using() -> Result<()> { | ||
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. 👍 definitely an improvement |
||
let results = execute( | ||
"SELECT t1.c1, t2.c2 FROM test t1 JOIN test t2 USING (c2) ORDER BY t2.c2", | ||
1, | ||
) | ||
.await?; | ||
assert_eq!(results.len(), 1); | ||
|
||
let expected = vec![ | ||
"+----+----+", | ||
"| c1 | c2 |", | ||
"+----+----+", | ||
"| 0 | 1 |", | ||
"| 0 | 2 |", | ||
"| 0 | 3 |", | ||
"| 0 | 4 |", | ||
"| 0 | 5 |", | ||
"| 0 | 6 |", | ||
"| 0 | 7 |", | ||
"| 0 | 8 |", | ||
"| 0 | 9 |", | ||
"| 0 | 10 |", | ||
"+----+----+", | ||
]; | ||
|
||
assert_batches_eq!(expected, &results); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn left_join_using_join_key_projection() -> Result<()> { | ||
let results = execute( | ||
"SELECT t1.c1, t1.c2, t2.c2 FROM test t1 JOIN test t2 USING (c2) ORDER BY t2.c2", | ||
1, | ||
) | ||
.await?; | ||
assert_eq!(results.len(), 1); | ||
|
||
let expected = vec![ | ||
"+----+----+----+", | ||
"| c1 | c2 | c2 |", | ||
"+----+----+----+", | ||
"| 0 | 1 | 1 |", | ||
"| 0 | 2 | 2 |", | ||
"| 0 | 3 | 3 |", | ||
"| 0 | 4 | 4 |", | ||
"| 0 | 5 | 5 |", | ||
"| 0 | 6 | 6 |", | ||
"| 0 | 7 | 7 |", | ||
"| 0 | 8 | 8 |", | ||
"| 0 | 9 | 9 |", | ||
"| 0 | 10 | 10 |", | ||
"+----+----+----+", | ||
]; | ||
|
||
assert_batches_eq!(expected, &results); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn left_join() -> Result<()> { | ||
let results = execute( | ||
"SELECT t1.c1, t1.c2, t2.c2 FROM test t1 JOIN test t2 ON t1.c2 = t2.c2 ORDER BY t1.c2", | ||
1, | ||
) | ||
.await?; | ||
assert_eq!(results.len(), 1); | ||
|
||
let expected = vec![ | ||
"+----+----+----+", | ||
"| c1 | c2 | c2 |", | ||
"+----+----+----+", | ||
"| 0 | 1 | 1 |", | ||
"| 0 | 2 | 2 |", | ||
"| 0 | 3 | 3 |", | ||
"| 0 | 4 | 4 |", | ||
"| 0 | 5 | 5 |", | ||
"| 0 | 6 | 6 |", | ||
"| 0 | 7 | 7 |", | ||
"| 0 | 8 | 8 |", | ||
"| 0 | 9 | 9 |", | ||
"| 0 | 10 | 10 |", | ||
"+----+----+----+", | ||
]; | ||
|
||
assert_batches_eq!(expected, &results); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn window() -> Result<()> { | ||
let results = execute( | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conversion handled by shared method in
serde/mod.rs