beliefer commented on a change in pull request #35130: URL: https://github.com/apache/spark/pull/35130#discussion_r780603780
########## File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala ########## @@ -223,7 +225,11 @@ abstract class JdbcDialect extends Serializable with Logging{ case f: GeneralAggregateFunc if f.name() == "AVG" => assert(f.inputs().length == 1) val distinct = if (f.isDistinct) "DISTINCT " else "" - Some(s"AVG($distinct${f.inputs().head})") + if (supportCompletePushDown) { + Some(s"AVG($distinct${f.inputs().head})") + } else { + Some(s"Sum($distinct${f.inputs().head}), Count($distinct${f.inputs().head})") Review comment: If Spark cannot complete pushdown AVG to database, we still want partial pushdown. -- 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: reviews-unsubscr...@spark.apache.org 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