Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/22008#discussion_r208802495
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -158,8 +158,9 @@ abstract class Optimizer(sessionCatalog: SessionCatalog)
ConvertToLocalRelation,
PropagateEmptyRelation) :+
// The following batch should be executed after batch "Join Reorder"
and "LocalRelation".
- Batch("Check Cartesian Products", Once,
- CheckCartesianProducts) :+
+ Batch("Check and Optimize Cartesian Products", Once,
+ CheckCartesianProducts,
+ ReorderCrossJoinOperands) :+
--- End diff --
IMO this optimization should be located in `CostBasedJoinReorder` or
`ReorderJoin`. Why is this an independent rule?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]