lyne7-sc commented on code in PR #2458:
URL: https://github.com/apache/auron/pull/2458#discussion_r3750276601
##########
spark-extension-shims-spark/src/test/scala/org/apache/auron/exec/AuronExecSuite.scala:
##########
@@ -43,6 +44,34 @@ class AuronExecSuite extends AuronQueryTest with
BaseAuronSQLSuite {
}
}
+ test("CollectLimit batches partition scans") {
+ withTempPath { path =>
+ spark.range(0, 80, 1, 8).write.parquet(path.getCanonicalPath)
+
+ withSQLConf(
+ SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false",
+ "spark.sql.files.maxPartitionBytes" -> "4096",
+ "spark.sql.limit.initialNumPartitions" -> "100") {
+ val df = spark.read.parquet(path.getCanonicalPath).where("id <
0").limit(1)
+ val collectLimit = collectFirst(df.queryExecution.executedPlan) {
+ case exec: NativeCollectLimitExec => exec
+ }.get
+ val numPartitions = collectLimit.child.execute().getNumPartitions
+ assert(numPartitions > 1 && numPartitions <= 100)
+
+ val jobGroup = s"collect-limit-${System.nanoTime()}"
+ spark.sparkContext.setJobGroup(jobGroup, "test CollectLimit job count")
+ try {
+ assert(collectLimit.executeCollect().isEmpty)
+ val jobCount =
spark.sparkContext.statusTracker.getJobIdsForGroup(jobGroup).length
Review Comment:
Good point. I added `sparkContext.listenerBus.waitUntilEmpty()` before
checking jobCount.
--
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]