urosstan-db commented on code in PR #58958:
URL: https://github.com/apache/spark/pull/58958#discussion_r4070216670
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/v2/JDBCV2JoinPushdownIntegrationSuiteBase.scala:
##########
@@ -299,6 +301,31 @@ trait JDBCV2JoinPushdownIntegrationSuiteBase
}
}
+ gridTest("Join pushdown preserves partitioned input reads")(Seq(1, 2)) {
numPartitions =>
+ val tableOptions = s"""WITH (
+ |'partitionColumn' '${caseConvert("id")}',
+ |'lowerBound' '0',
+ |'upperBound' '11',
+ |'numPartitions' '$numPartitions')""".stripMargin
+ val sqlQuery = s"""
+ |SELECT a.id, b.id
+ |FROM $catalogAndNamespace.$casedJoinTableName1 $tableOptions a
+ |JOIN $catalogAndNamespace.$casedJoinTableName1 $tableOptions b ON a.id
= b.id + 1
+ |""".stripMargin
+
+ val expectedRows = for {
+ (leftId, _, _) <- table1Data
+ (rightId, _, _) <- table1Data
+ if leftId == rightId + 1
+ } yield Row(leftId, rightId)
Review Comment:
Add assertion here that row count matches
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/v2/JDBCV2JoinPushdownIntegrationSuiteBase.scala:
##########
@@ -299,6 +301,31 @@ trait JDBCV2JoinPushdownIntegrationSuiteBase
}
}
+ gridTest("Join pushdown preserves partitioned input reads")(Seq(1, 2)) {
numPartitions =>
+ val tableOptions = s"""WITH (
+ |'partitionColumn' '${caseConvert("id")}',
+ |'lowerBound' '0',
+ |'upperBound' '11',
+ |'numPartitions' '$numPartitions')""".stripMargin
+ val sqlQuery = s"""
+ |SELECT a.id, b.id
+ |FROM $catalogAndNamespace.$casedJoinTableName1 $tableOptions a
+ |JOIN $catalogAndNamespace.$casedJoinTableName1 $tableOptions b ON a.id
= b.id + 1
+ |""".stripMargin
+
+ val expectedRows = for {
+ (leftId, _, _) <- table1Data
+ (rightId, _, _) <- table1Data
+ if leftId == rightId + 1
+ } yield Row(leftId, rightId)
Review Comment:
Add assertion here that row count > 0
--
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]