mingmwang commented on code in PR #6457:
URL: https://github.com/apache/arrow-datafusion/pull/6457#discussion_r1210039771


##########
datafusion/core/tests/sql/joins.rs:
##########
@@ -2030,7 +2030,7 @@ async fn subquery_to_join_with_both_side_expr() -> 
Result<()> {
         "  LeftSemi Join: CAST(t1.t1_id AS Int64) + Int64(12) = 
__correlated_sq_1.CAST(t2_id AS Int64) + Int64(1) [t1_id:UInt32;N, 
t1_name:Utf8;N, t1_int:UInt32;N]",
         "    TableScan: t1 projection=[t1_id, t1_name, t1_int] 
[t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
         "    SubqueryAlias: __correlated_sq_1 [CAST(t2_id AS Int64) + 
Int64(1):Int64;N]",
-        "      Projection: CAST(t2.t2_id AS Int64) + Int64(1) AS CAST(t2_id AS 
Int64) + Int64(1) [CAST(t2_id AS Int64) + Int64(1):Int64;N]",
+        "      Projection: CAST(t2.t2_id AS Int64) + Int64(1) AS t2.t2_id + 
Int64(1) AS CAST(t2_id AS Int64) + Int64(1) [CAST(t2_id AS Int64) + 
Int64(1):Int64;N]",

Review Comment:
   The  double alias is not caused by the decorrelate rules. It's caused by the 
other logical optimization rule:
   
   ```
   new_plan LeftSemi Join:  Filter: CAST(t1.t1_id AS Int64) + Int64(12) = 
__correlated_sq_3.CAST(t2_id AS Int64) + Int64(1)
     TableScan: t1
     SubqueryAlias: __correlated_sq_3
       Projection: CAST(t2.t2_id AS Int64) + Int64(1) AS CAST(t2_id AS Int64) + 
Int64(1), CAST(t2.t2_id AS Int64) + Int64(1)
         TableScan: t2
   
   ```



-- 
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]

Reply via email to