This is an automated email from the ASF dual-hosted git repository.

yangzy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 920f62f189 [VL][MINOR] Move HLL rewrite check to the beginning of the 
rule (#9071)
920f62f189 is described below

commit 920f62f18971f7c7043c4469342918d82842ec92
Author: Yang Zhang <[email protected]>
AuthorDate: Sun Mar 23 16:24:19 2025 +0800

    [VL][MINOR] Move HLL rewrite check to the beginning of the rule (#9071)
---
 .../scala/org/apache/gluten/extension/HLLRewriteRule.scala     | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/backends-velox/src/main/scala/org/apache/gluten/extension/HLLRewriteRule.scala
 
b/backends-velox/src/main/scala/org/apache/gluten/extension/HLLRewriteRule.scala
index e15fb05330..6283df27f4 100644
--- 
a/backends-velox/src/main/scala/org/apache/gluten/extension/HLLRewriteRule.scala
+++ 
b/backends-velox/src/main/scala/org/apache/gluten/extension/HLLRewriteRule.scala
@@ -29,13 +29,17 @@ import org.apache.spark.sql.types._
 
 case class HLLRewriteRule(spark: SparkSession) extends Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = {
+    if (
+      !GlutenConfig.get.enableNativeHyperLogLogAggregateFunction ||
+      !GlutenConfig.get.enableColumnarHashAgg
+    ) {
+      return plan
+    }
     plan.transformUpWithPruning(_.containsPattern(AGGREGATE)) {
       case a: Aggregate =>
         
a.transformExpressionsWithPruning(_.containsPattern(AGGREGATE_EXPRESSION)) {
           case aggExpr @ AggregateExpression(hll: HyperLogLogPlusPlus, _, _, 
_, _)
-              if GlutenConfig.get.enableNativeHyperLogLogAggregateFunction &&
-                GlutenConfig.get.enableColumnarHashAgg &&
-                isSupportedDataType(hll.child.dataType) =>
+              if isSupportedDataType(hll.child.dataType) =>
             val hllAdapter = HLLAdapter(
               hll.child,
               Literal(hll.relativeSD),


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

Reply via email to