dqkqd commented on code in PR #18236:
URL: https://github.com/apache/datafusion/pull/18236#discussion_r2457281905
##########
datafusion/core/tests/dataframe/mod.rs:
##########
@@ -543,6 +592,54 @@ async fn drop_with_periods() -> Result<()> {
Ok(())
}
+#[tokio::test]
+async fn drop_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::LeftMark, &["c1"], &["c1"], None)?
+ .join(t3, JoinType::LeftMark, &["c1"], &["c1"], None)?;
+ assert_snapshot!(
+ batches_to_sort_string(&join_res.clone().collect().await.unwrap()),
+ @r"
+ +----+-------+-------+
+ | c1 | mark | mark |
+ +----+-------+-------+
+ | b | true | false |
+ | c | false | false |
+ | d | false | true |
+ +----+-------+-------+
+ "
+ );
+
+ let drop_res = join_res.drop_columns(&["mark"])?;
+ assert_snapshot!(
+ batches_to_sort_string(&drop_res.clone().collect().await.unwrap()),
+ @r"
+ +----+
+ | c1 |
+ +----+
+ | b |
+ | c |
+ | d |
+ +----+
+ "
+ );
+
+ Ok(())
+}
Review Comment:
This failed without the code changes
```
running 1 test
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: drop_columns_duplicated_names_from_different_qualifiers-2
Source: datafusion/core/tests/dataframe/mod.rs:627
────────────────────────────────────────────────────────────────────────────────
Expression:
batches_to_sort_string(&drop_res.clone().collect().await.unwrap())
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
1 │-+----+
2 │-| c1 |
3 │-+----+
4 │-| b |
5 │-| c |
6 │-| d |
7 │-+----+
1 │++----+-------+-------+
2 │+| c1 | mark | mark |
3 │++----+-------+-------+
4 │+| b | true | false |
5 │+| c | false | false |
6 │+| d | false | true |
7 │++----+-------+-------+
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all
snapshots.
test dataframe::drop_columns_duplicated_names_from_different_qualifiers
... FAILED
failures:
failures:
dataframe::drop_columns_duplicated_names_from_different_qualifiers
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 769
filtered out; finished in 0.17s
```
--
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]