lgbo-ustc commented on code in PR #7779:
URL: https://github.com/apache/incubator-gluten/pull/7779#discussion_r1831945028


##########
backends-clickhouse/src/main/scala/org/apache/gluten/extension/PushdownAggregatePreProjectionAheadExpand.scala:
##########
@@ -93,11 +93,33 @@ case class 
PushdownAggregatePreProjectionAheadExpand(session: SparkSession)
           return hashAggregate
         }
 
+        def projectInputExists(expr: Expression, inputs: Seq[Attribute]): 
Boolean = {
+          expr.children.foreach {
+            case a: Attribute =>
+              var exist = false
+              for (input <- inputs if input.name.equals(a.name) && 
input.exprId.equals(a.exprId)) {
+                exist = true
+              }
+              return exist
+            case p: Expression =>
+              return projectInputExists(p, inputs)
+            case _ =>
+              return true
+          }
+          true
+        }
+
+        preProjectExprs.foreach(
+          p => {
+            if (!projectInputExists(p, rootChild.output)) {
+              return hashAggregate
+            }
+          })
+

Review Comment:
   expr这里做了类型匹配,非attribute返回true



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