beliefer commented on a change in pull request #35823:
URL: https://github.com/apache/spark/pull/35823#discussion_r828724079
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala
##########
@@ -93,22 +92,28 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan]
with PredicateHelper {
case aggNode @ Aggregate(groupingExpressions, resultExpressions, child) =>
child match {
case ScanOperation(project, filters, sHolder: ScanBuilderHolder)
- if filters.isEmpty &&
project.forall(_.isInstanceOf[AttributeReference]) =>
+ if filters.isEmpty && project.forall(_.deterministic) =>
sHolder.builder match {
case r: SupportsPushDownAggregates =>
+ val aliasMap = getAliasMap(project)
+ val newResultExpressions =
resultExpressions.map(replaceAliasWithAttr(_, aliasMap))
+ val newGroupingExpressions = groupingExpressions.map {
+ case e: NamedExpression => replaceAliasWithAttr(e, aliasMap)
+ case other => other
+ }
Review comment:
Thank you for the good idea.
--
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]