maropu commented on a change in pull request #31901:
URL: https://github.com/apache/spark/pull/31901#discussion_r598272364



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -70,10 +70,19 @@ abstract class Optimizer(catalogManager: CatalogManager)
   def defaultBatches: Seq[Batch] = {
     val operatorOptimizationRuleSet =
       Seq(
-        // Operator push down
-        PushProjectionThroughUnion,
+        // Optimize join
         ReorderJoin,
         EliminateOuterJoin,
+        // Simplify expressions
+        BooleanSimplification,
+        SimplifyConditionals,
+        PushFoldableIntoBranches,
+        RemoveDispensableExpressions,
+        SimplifyBinaryComparison,
+        ReplaceNullWithFalseInPredicate,
+        SimplifyConditionalsInPredicate,

Review comment:
       It seems the rules that simplify exprs still exist at the bottom (e.g., 
`SimplifyCasts` and `SimplifyExtractValueOps`. We don't need to move them, too?




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