beliefer commented on a change in pull request #35823:
URL: https://github.com/apache/spark/pull/35823#discussion_r827564615



##########
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:
       ```
   Aggregate [myDept#0], 
[((cast(sum(CheckOverflow((promote_precision(cast(mySalary#1 as decimal(23,2))) 
+ promote_precision(cast(yourSalary#2 as decimal(23,2)))), DecimalType(23,2))) 
as double) + max((cast(mySalary#1 as double) - bonus#6))) + cast(myDept#0 as 
double)) AS ((sum((mySalary + yourSalary)) + max((mySalary - bonus))) + 
myDept)#9]
   +- Project [dept#3 AS myDept#0, 
CheckOverflow((promote_precision(cast(salary#5 as decimal(21,2))) + 1.00), 
DecimalType(21,2)) AS mySalary#1, CheckOverflow((promote_precision(salary#5) * 
2.00), DecimalType(22,2)) AS yourSalary#2, bonus#6]
      +- ScanBuilderHolder [DEPT#3, NAME#4, SALARY#5, BONUS#6], 
RelationV2[DEPT#3, NAME#4, SALARY#5, BONUS#6] test.employee, 
JDBCScanBuilder(org.apache.spark.sql.test.TestSparkSession@463a1f47,StructType(StructField(DEPT,IntegerType,true),StructField(NAME,StringType,true),StructField(SALARY,DecimalType(20,2),true),StructField(BONUS,DoubleType,true)),org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions@47224d5d)
   ```
   cast, CheckOverflow, promote_precision not supported in aggregate push-down.
   I updated description of PR and add a plan.




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