maropu commented on a change in pull request #29695: URL: https://github.com/apache/spark/pull/29695#discussion_r498593284
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala ########## @@ -643,6 +647,34 @@ object DataSourceStrategy { (nonconvertiblePredicates ++ unhandledPredicates, pushedFilters, handledFilters) } + def translateAggregate(aggregates: AggregateExpression): Option[AggregateFunc] = { + + def columnAsString(e: Expression): String = e match { + case AttributeReference(name, _, _, _) => name + case Cast(child, _, _) => child match { Review comment: For example, how about the fractional case? If `e` is float, we should not remove the cast but pass it into a database side for computing double-typed partial aggregated values? ``` case Sum(e @ FractionalType()) if e.dataType != DoubleType => Sum(Cast(e, DoubleType)) ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org