zhztheplayer commented on code in PR #5058:
URL: https://github.com/apache/incubator-gluten/pull/5058#discussion_r1533334672


##########
gluten-core/src/main/scala/io/glutenproject/extension/ColumnarOverrides.scala:
##########
@@ -223,6 +224,23 @@ case class ColumnarOverrideRules(session: SparkSession)
    * the plan will be breakdown and decided to be fallen back or not.
    */
   private def transformRules(outputsColumnar: Boolean): List[SparkSession => 
Rule[SparkPlan]] = {
+
+    def maybeCbo(outputsColumnar: Boolean): List[SparkSession => 
Rule[SparkPlan]] = {
+      if (GlutenConfig.getConf.enableAdvancedCbo) {
+        return List(
+          (_: SparkSession) => FilterTransformRule(),
+          (session: SparkSession) => EnumeratedTransform(session, 
outputsColumnar),
+          (_: SparkSession) => RemoveTransitions,
+          (_: SparkSession) => AggregationTransformRule()
+        )
+      }
+      List(
+        (_: SparkSession) => FilterTransformRule(),
+        (_: SparkSession) => TransformPreOverrides(),
+        (_: SparkSession) => AggregationTransformRule()
+      )

Review Comment:
   So far CBO optimization happens inside Spark rule `EnumeratedTransform`.



##########
gluten-core/src/main/scala/io/glutenproject/extension/ColumnarOverrides.scala:
##########
@@ -223,6 +224,23 @@ case class ColumnarOverrideRules(session: SparkSession)
    * the plan will be breakdown and decided to be fallen back or not.
    */
   private def transformRules(outputsColumnar: Boolean): List[SparkSession => 
Rule[SparkPlan]] = {
+
+    def maybeCbo(outputsColumnar: Boolean): List[SparkSession => 
Rule[SparkPlan]] = {
+      if (GlutenConfig.getConf.enableAdvancedCbo) {
+        return List(
+          (_: SparkSession) => FilterTransformRule(),
+          (session: SparkSession) => EnumeratedTransform(session, 
outputsColumnar),
+          (_: SparkSession) => RemoveTransitions,
+          (_: SparkSession) => AggregationTransformRule()
+        )
+      }
+      List(
+        (_: SparkSession) => FilterTransformRule(),
+        (_: SparkSession) => TransformPreOverrides(),
+        (_: SparkSession) => AggregationTransformRule()
+      )

Review Comment:
   So far ACBO optimization happens inside Spark rule `EnumeratedTransform`.



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


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

Reply via email to