LiaCastaneda commented on code in PR #17478:
URL: https://github.com/apache/datafusion/pull/17478#discussion_r2336892055


##########
datafusion/substrait/tests/cases/consumer_integration.rs:
##########
@@ -605,26 +605,30 @@ mod tests {
     #[tokio::test]
     async fn test_multiple_joins() -> Result<()> {
         let plan_str = test_plan_to_string("multiple_joins.json").await?;
-        assert_eq!(
+        assert_snapshot!(
             plan_str,
-            "Projection: left.count(Int64(1)) AS count_first, left.category, 
left.count(Int64(1)):1 AS count_second, right.count(Int64(1)) AS count_third\
-            \n  Left Join: left.id = right.id\
-            \n    SubqueryAlias: left\
-            \n      Left Join: left.id = right.id\
-            \n        SubqueryAlias: left\
-            \n          Left Join: left.id = right.id\
-            \n            SubqueryAlias: left\
-            \n              Aggregate: groupBy=[[id]], 
aggr=[[count(Int64(1))]]\
-            \n                Values: (Int64(1)), (Int64(2))\
-            \n            SubqueryAlias: right\
-            \n              Aggregate: groupBy=[[id, category]], aggr=[[]]\
-            \n                Values: (Int64(1), Utf8(\"info\")), (Int64(2), 
Utf8(\"low\"))\
-            \n        SubqueryAlias: right\
-            \n          Aggregate: groupBy=[[id]], aggr=[[count(Int64(1))]]\
-            \n            Values: (Int64(1)), (Int64(2))\
-            \n    SubqueryAlias: right\
-            \n      Aggregate: groupBy=[[id]], aggr=[[count(Int64(1))]]\
-            \n        Values: (Int64(1)), (Int64(2))"
+            @r#"
+        Projection: left.count(Int64(1)) AS count_first, left.category, 
left.count(Int64(1)):1 AS count_second, right.count(Int64(1)) AS count_third
+          Left Join: left.id = right.id
+            SubqueryAlias: left
+              Projection: left.id, left.count(Int64(1)), left.id:1, 
left.category, right.id AS id:2, right.count(Int64(1)) AS count(Int64(1)):1

Review Comment:
   Also, I was looking into the logical optimizer and there is 
[this](https://docs.rs/datafusion/latest/datafusion/optimizer/optimize_projections/index.html)
 rule to remove unnecessary projections, I don't think it will remove this one 
but maybe worth checking?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to