cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643312015



##########
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)

Review comment:
       This doesn't prove that we can optimize the project away. How about
   ```
   assert(stripAQEPlan(adaptivePlan1).isInstanceOf[LocalTableScanExec])
   ```




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to