cloud-fan commented on a change in pull request #32724: URL: https://github.com/apache/spark/pull/32724#discussion_r643615648
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala ########## @@ -1373,6 +1386,28 @@ class AdaptiveQueryExecSuite } } + test("SPARK-35585: Support propagate empty relation through project/filter") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val (plan1, adaptivePlan1) = runAdaptiveAndVerifyResult( + "SELECT key FROM testData WHERE key = 0 ORDER BY key, value") + assert(findTopLevelSort(plan1).size == 1) + assert(findTopLevelSort(adaptivePlan1).isEmpty) + + val (plan2, adaptivePlan2) = runAdaptiveAndVerifyResult( + """ + |SELECT t1.key, count(*) FROM testData t1 Review comment: ok, we can use rand() then ``` SELECT key FROM (SELECT * FROM testData WHERE value = 'no_match' ORDER BY key) WHERE key > rand() ``` -- 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