cloud-fan commented on a change in pull request #35823:
URL: https://github.com/apache/spark/pull/35823#discussion_r826955158
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala
##########
@@ -92,23 +91,27 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan]
with PredicateHelper {
// update the scan builder with agg pushdown and return a new plan with
agg pushed
case aggNode @ Aggregate(groupingExpressions, resultExpressions, child) =>
child match {
- case ScanOperation(project, filters, sHolder: ScanBuilderHolder)
- if filters.isEmpty &&
project.forall(_.isInstanceOf[AttributeReference]) =>
+ case ScanOperation(project, filters, sHolder: ScanBuilderHolder) if
filters.isEmpty &&
Review comment:
We need to clearly describe the final plan. This is more complicated now
as the project may contain arbitrary expressions.
For example
```
Aggregate(sum(a + b) + max(a - c) + a, group by a,
Project(x + 1 as a, x * 2 as b , x + y as c,
Table(x, y, z)
)
)
```
what the final plan looks like if the aggregate can be pushed, or can be
partial pushed, or can't be pushed.
--
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]