bvolpato commented on code in PR #27192:
URL: https://github.com/apache/datafusion/pull/27192#discussion_r4746410340
##########
datafusion/substrait/src/logical_plan/consumer/rel/join_rel.rs:
##########
@@ -245,11 +286,29 @@ mod tests {
None,
)
.eq(col("b"));
-
- let (keys, _, filter) =
- split_eq_and_noneq_join_predicate_with_nulls_equality(expr);
+ let (keys, _, filter) = split(expr);
assert!(keys.is_empty());
assert_eq!(filter.unwrap().to_string(), "Utf8(\"x\") = b");
}
+
+ #[test]
+ fn split_same_side_indistinct_comparison_to_filter() {
Review Comment:
https://github.com/apache/datafusion/blob/5897a39a20a2ea77c6c05c1624217de71ed868fe/datafusion/substrait/src/logical_plan/consumer/rel/join_rel.rs#L305-L313
##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -1298,6 +1298,39 @@ async fn roundtrip_left_join() -> Result<()> {
roundtrip("SELECT data.a FROM data LEFT JOIN data2 ON data.a =
data2.a").await
}
+#[tokio::test]
+async fn roundtrip_left_join_with_same_side_equality() -> Result<()> {
+ let ctx = SessionContext::new();
+ let sql = "SELECT l.a, l.b, r.a AS ra \
+ FROM (VALUES (1, 1), (2, 3), (3, 3)) l(a, b) \
+ LEFT JOIN (VALUES (1), (2), (3)) r(a) \
+ ON r.a = l.a AND l.a = l.b \
+ ORDER BY l.a";
+
+ let plans = [
+ ctx.sql(sql).await?.into_unoptimized_plan(),
+ ctx.sql(sql).await?.into_optimized_plan()?,
+ ];
+ for plan in plans {
Review Comment:
https://github.com/apache/datafusion/blob/5897a39a20a2ea77c6c05c1624217de71ed868fe/datafusion/substrait/tests/cases/roundtrip_logical_plan.rs#L1310-L1321
--
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]