LuciferYang commented on a change in pull request #29434:
URL: https://github.com/apache/spark/pull/29434#discussion_r472291588



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/StarJoinCostBasedReorderSuite.scala
##########
@@ -329,7 +329,7 @@ class StarJoinCostBasedReorderSuite extends PlanTest with 
StatsEstimationTestBas
     //
     // Number of generated plans: 46 (vs. 82)
     val query =
-      
d1.join(t3).join(t4).join(f1).join(d2).join(t5).join(t6).join(d3).join(t1).join(t2)
+      
d1.join(t3).join(t4).join(f1).join(d3).join(d2).join(t5).join(t6).join(t1).join(t2)

Review comment:
        @ioana-delaney Another infomation is Scala 2.13 tends to optimization 
results as 
   
   ```
   Join Inner, (d1_pk#5 = f1_fk1#0)
   :- Join Inner, (f1_fk2#1 = d2_pk#8)
   :  :- Join Inner, (f1_fk3#2 = d3_pk#11)
   ```
   
   and Scala 2.12 tends to  optimization results as 
   
   ```
   Join Inner, (f1_fk2#1 = d2_pk#8)
   :- Join Inner, (d1_pk#5 = f1_fk1#0)
   :  :- Join Inner, (f1_fk3#2 = d3_pk#11)
   ```
   
   If the input is reordered to 
`d1.join(t3).join(d3).join(t5).join(t1).join(t2).join(d2).join(f1).join(t6).join(t4)`
 in Scala 2.12, the optimization results  will change to 
    
   ```
   Join Inner, (d1_pk#5 = f1_fk1#0)
   :- Join Inner, (f1_fk2#1 = d2_pk#8)
   :  :- Join Inner, (f1_fk3#2 = d3_pk#11)
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to