KevinyhZou commented on code in PR #7779:
URL: https://github.com/apache/incubator-gluten/pull/7779#discussion_r1830729962
##########
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:
通过判断 `childInputAttrbutes.indexOf(attribute) != -1` 是不行的,expr
的类型可能是Expression,还需要对Expression中的children进行判断。
--
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]