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

lgbo 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 e63b7d5828 fixed bug in finding attributes in replacement map (#7927)
e63b7d5828 is described below

commit e63b7d5828133e2a4c085b87d7039ac68997b27e
Author: lgbo <[email protected]>
AuthorDate: Wed Nov 13 14:06:57 2024 +0800

    fixed bug in finding attributes in replacement map (#7927)
---
 .../scala/org/apache/gluten/extension/LazyAggregateExpandRule.scala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/backends-clickhouse/src/main/scala/org/apache/gluten/extension/LazyAggregateExpandRule.scala
 
b/backends-clickhouse/src/main/scala/org/apache/gluten/extension/LazyAggregateExpandRule.scala
index 86b28ab1f7..d21cbfa250 100644
--- 
a/backends-clickhouse/src/main/scala/org/apache/gluten/extension/LazyAggregateExpandRule.scala
+++ 
b/backends-clickhouse/src/main/scala/org/apache/gluten/extension/LazyAggregateExpandRule.scala
@@ -335,7 +335,9 @@ case class LazyAggregateExpandRule(session: SparkSession) 
extends Rule[SparkPlan
     val groupingExpressions =
       partialAggregate.groupingExpressions
         .filter(
-          e => e.toAttribute != groupIdAttribute && 
attributesToReplace.contains(e.toAttribute))
+          e =>
+            !e.toAttribute.semanticEquals(groupIdAttribute) &&
+              attributesToReplace.find(kv => 
kv._1.semanticEquals(e.toAttribute)).isDefined)
         .map(e => getReplaceAttribute(e.toAttribute, attributesToReplace))
         .distinct
     logDebug(
@@ -344,7 +346,7 @@ case class LazyAggregateExpandRule(session: SparkSession) 
extends Rule[SparkPlan
 
     // Remove group id column from result expressions
     val resultExpressions = partialAggregate.resultExpressions
-      .filter(_.toAttribute != groupIdAttribute)
+      .filter(!_.toAttribute.semanticEquals(groupIdAttribute))
       .map(e => getReplaceAttribute(e.toAttribute, attributesToReplace))
     logDebug(
       s"xxx newResultExpressions: $resultExpressions\n" +


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

Reply via email to