Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.3k
fix join column handling logic for On and Using constraints#605
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c97e550702a5a0c462206ccbb844091bb75e97b86aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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; | ||
| 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<()> { | ||
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. 👍 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( | ||
Uh oh!
There was an error while loading. Please reload this page.
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