Skip to content

[WIP] nestedjoin with alias #3030

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions datafusion/core/tests/sql/joins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,24 @@ async fn inner_join_qualified_names() -> Result<()> {
Ok(())
}

#[tokio::test]
async fn nestedjoin_with_alias() -> Result<()> {
// repro case for https://github.com/apache/arrow-datafusion/issues/2867
let sql = "select * from ((select 1 as a, 2 as b) c INNER JOIN (select 1 as a, 3 as d) e on c.a = e.a) f;";
let expected = vec![
"+---+---+---+---+",
"| a | b | c | d |",
"+----+--+---+---|",
"| 1 | 2 | 1 | 3 |",
"+---+---+---+---+",
];
let ctx = SessionContext::new();
let actual = execute_to_batches(&ctx, sql).await;
assert_batches_eq!(expected, &actual);

Ok(())
}

#[tokio::test]
async fn issue_3002() -> Result<()> {
// repro case for https://github.com/apache/arrow-datafusion/issues/3002
Expand Down