urosstan-db commented on code in PR #58958:
URL: https://github.com/apache/spark/pull/58958#discussion_r4067523901
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/v2/JDBCV2JoinPushdownIntegrationSuiteBase.scala:
##########
@@ -477,6 +503,42 @@ trait JDBCV2JoinPushdownIntegrationSuiteBase
}
}
+ test("Join pushdown preserves aliases in partially pushed averages") {
+ assume(supportsAggregatePushdown, "Aggregate pushdown is not supported")
+ val id = caseConvert("id")
+ def sqlPartitionedQuery(numPartitions: Int): String = {
+ // numPartitions alone is valid and selects the partial aggregate path
when greater than 1.
+ val tableOptions = s"WITH ('numPartitions' '$numPartitions')"
+ // Some databases return an integer for AVG over integer input, so use
decimal input.
+ s"""
+ |SELECT avg(CAST(b.$id AS DECIMAL(10, 2)))
+ |FROM $catalogAndNamespace.$casedJoinTableName1 $tableOptions a
+ |JOIN $catalogAndNamespace.$casedJoinTableName1 $tableOptions b ON
a.$id = b.$id + 1
+ |""".stripMargin
+ }
+
+ val rows = withSQLConf(SQLConf.DATA_SOURCE_V2_JOIN_PUSHDOWN.key -> "true")
{
Review Comment:
Use better naming, e.g. rowsWithJoinPushdown
--
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]