dqkqd commented on code in PR #18236:
URL: https://github.com/apache/datafusion/pull/18236#discussion_r2457280332
##########
datafusion/core/tests/dataframe/mod.rs:
##########
@@ -405,6 +405,55 @@ async fn select_with_periods() -> Result<()> {
Ok(())
}
+#[tokio::test]
+async fn select_columns_duplicated_names_from_different_qualifiers() ->
Result<()> {
+ let t1 = test_table_with_name("t1")
+ .await?
+ .select_columns(&["c1"])?
+ .limit(0, Some(3))?;
+ let t2 = test_table_with_name("t2")
+ .await?
+ .select_columns(&["c1"])?
+ .limit(3, Some(3))?;
+ let t3 = test_table_with_name("t3")
+ .await?
+ .select_columns(&["c1"])?
+ .limit(6, Some(3))?;
+
+ let join_res = t1
+ .join(t2, JoinType::Left, &["t1.c1"], &["t2.c1"], None)?
+ .join(t3, JoinType::Left, &["t1.c1"], &["t3.c1"], None)?;
+ assert_snapshot!(
+ batches_to_sort_string(&join_res.clone().collect().await.unwrap()),
+ @r"
+ +----+----+----+
+ | c1 | c1 | c1 |
+ +----+----+----+
+ | b | b | |
+ | b | b | |
+ | c | | |
+ | d | | d |
+ +----+----+----+
+ "
+ );
+
+ let select_res = join_res.select_columns(&["c1"])?;
Review Comment:
This line returned `SchemaError` without the code changes.
```
Error: SchemaError(AmbiguousReference { field: Column { relation: None,
name: "c1" } }, Some(""))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]