You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/01 05:37:11 UTC

[GitHub] [spark] ulysses-you opened a new pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

ulysses-you opened a new pull request #32724:
URL: https://github.com/apache/spark/pull/32724


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error message, please read the guideline first:
        https://spark.apache.org/error-message-guidelines.html
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   Add rule `ConvertToLocalRelation` into AQE Optimizer.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Support propagate empty local relation through project and filter like such SQL case:
   ```
   Aggregate
     Project
       Join
         ShuffleStage
         ShuffleStage
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Add test.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] yaooqinn commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643314702



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -27,9 +28,15 @@ import org.apache.spark.util.Utils
  * The optimizer for re-optimizing the logical plan used by AdaptiveSparkPlanExec.
  */
 class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
+  private def fixedPoint =
+    FixedPoint(
+      conf.optimizerMaxIterations,

Review comment:
       do we need a separate conf for `AQEOptimizer`




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852721567


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43712/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852676037


   **[Test build #139192 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139192/testReport)** for PR 32724 at commit [`c119956`](https://github.com/apache/spark/commit/c119956890582b5862749993bc2610274b699820).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852756658


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43717/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642811199



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -27,9 +28,15 @@ import org.apache.spark.util.Utils
  * The optimizer for re-optimizing the logical plan used by AdaptiveSparkPlanExec.
  */
 class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
+  private def fixedPoint =
+    FixedPoint(
+      SQLConf.get.optimizerMaxIterations,

Review comment:
       nit: `conf.optimizerMaxIterations`




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852795005


   **[Test build #139192 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139192/testReport)** for PR 32724 at commit [`c119956`](https://github.com/apache/spark/commit/c119956890582b5862749993bc2610274b699820).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851879509


   **[Test build #139145 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139145/testReport)** for PR 32724 at commit [`ee3cf4b`](https://github.com/apache/spark/commit/ee3cf4b67b28e502f3a4a2092da8ed854aaa384f).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643138003



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       Seems the issue won't happen since we clone the plan step-by-step ( i.e. analyzer/optimizer/physical ) and the ineffective tag won't exist after clone.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642811083



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       I don't get it. There is nothing special in AQE and why not just use `ConvertToLocalRelation`?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643313848



##########
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:
       We can use limit to test the filter case as Spark can't pushdown filter through limit
   ```
   SELECT key FROM (SELECT * FROM testData WHERE key = 0 LIMIT 1) WHERE value IS NOT NULL
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852699502


   **[Test build #139195 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139195/testReport)** for PR 32724 at commit [`c7996bb`](https://github.com/apache/spark/commit/c7996bbdfc7af288979ea65102e7637d4c5da1a7).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852275837


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43690/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642812433



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -1373,6 +1380,31 @@ 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") {
+      Seq(
+        """
+         |SELECT t1.key, count(*) FROM testData t1
+         | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a
+         | GROUP BY t1.key
+         |""".stripMargin,
+        """
+          |SELECT t1.key, count(*) FROM testData t1
+          | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a
+          | WHERE t1.key > rand()

Review comment:
       what does this predicate test?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852258914


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43685/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643606101



##########
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:
       Updated.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851889345


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43657/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852796152


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139192/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851949819


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43665/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852366354


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139170/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852712631


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43712/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643313848



##########
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:
       We can use limit to test the filter case as Spark can't pushdown filter through limit
   ```
   SELECT key FROM (SELECT * FROM testData WHERE key = 0 LIMIT 1) WHERE value = 'a'
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643215852



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -1373,6 +1380,31 @@ 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") {
+      Seq(
+        """
+         |SELECT t1.key, count(*) FROM testData t1
+         | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a

Review comment:
       yeah we can use sort instead. Updated.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852366354


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139170/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852284162


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43685/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643626088



##########
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 done.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851867518


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43657/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852796152


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139192/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852697807


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43712/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851906316


   **[Test build #139138 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139138/testReport)** for PR 32724 at commit [`42a217e`](https://github.com/apache/spark/commit/42a217e7c97afc2b74016b9432843ea964f44c7d).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `trait ConvertToLocalRelationBase extends Rule[LogicalPlan] `


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852721567


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43712/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851909794






-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852756658


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43717/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852676037


   **[Test build #139192 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139192/testReport)** for PR 32724 at commit [`c119956`](https://github.com/apache/spark/commit/c119956890582b5862749993bc2610274b699820).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852238335


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139165/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642840787



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       If that's the goal I think we should update the tracking system to measure the effectiveness of AQE optimizer rules separately.
   
   It's super annoying to do this again and again for every normal optimizer rule we add to AQE. e.g. why don't we do it for `UpdateAttributeNullability`?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852299941


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43690/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851834150


   cc @maropu @cloud-fan @yaooqinn 


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851839022


   **[Test build #139138 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139138/testReport)** for PR 32724 at commit [`42a217e`](https://github.com/apache/spark/commit/42a217e7c97afc2b74016b9432843ea964f44c7d).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851879509


   **[Test build #139145 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139145/testReport)** for PR 32724 at commit [`ee3cf4b`](https://github.com/apache/spark/commit/ee3cf4b67b28e502f3a4a2092da8ed854aaa384f).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851839022


   **[Test build #139138 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139138/testReport)** for PR 32724 at commit [`42a217e`](https://github.com/apache/spark/commit/42a217e7c97afc2b74016b9432843ea964f44c7d).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642832851



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -1373,6 +1380,31 @@ 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") {
+      Seq(
+        """
+         |SELECT t1.key, count(*) FROM testData t1
+         | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a
+         | GROUP BY t1.key
+         |""".stripMargin,
+        """
+          |SELECT t1.key, count(*) FROM testData t1
+          | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a
+          | WHERE t1.key > rand()

Review comment:
       test filter case
   ```
   Aggregate
     Project
       Filter
         Join
           ShuffleStage
           ShuffleStage
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852329989


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43690/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852240637


   **[Test build #139170 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139170/testReport)** for PR 32724 at commit [`41b1c97`](https://github.com/apache/spark/commit/41b1c977bce081bdba2a22364a84f3215b2e6f70).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851972228


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43665/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852838327


   thanks for merging !


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643607037



##########
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:
       If `limit` is not the top-level node, we will introduce extra shuffle node for the `SinglePartition`. It will make plan complex.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852153631


   **[Test build #139165 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139165/testReport)** for PR 32724 at commit [`71cac38`](https://github.com/apache/spark/commit/71cac38b1740de26d071da3c864dd2619aefbf8c).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852284162


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43685/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642797088



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1711,7 +1711,7 @@ object DecimalAggregates extends Rule[LogicalPlan] {
  * Converts local operations (i.e. ones that don't require data exchange) on `LocalRelation` to
  * another `LocalRelation`.
  */
-object ConvertToLocalRelation extends Rule[LogicalPlan] {
+trait ConvertToLocalRelationBase extends Rule[LogicalPlan] {

Review comment:
       this is for isolation between normal and AQE optimizer




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852329989


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/43690/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851992908






-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852699502


   **[Test build #139195 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139195/testReport)** for PR 32724 at commit [`c7996bb`](https://github.com/apache/spark/commit/c7996bbdfc7af288979ea65102e7637d4c5da1a7).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642867026



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       I was asking why we don't have `AQEUpdateAttributeNullability`.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852191233


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43685/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642845898



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       It should also do this. `UpdateAttributeNullability ` updated to `resolveOperatorsUpWithPruning` just now...  see the merged PR [#32686](https://github.com/apache/spark/pull/32686).




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851909794






-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643313848



##########
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:
       We can use limit to test the filter case as Spark can't pushdown filter through limit
   ```
   SELECT key FROM (SELECT key FROM testData WHERE key = 0 LIMIT 1)
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852821938


   thanks, merging to master!


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852720338


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43717/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852735448


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43717/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852831866


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139195/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851992908






-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-851984692


   **[Test build #139145 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139145/testReport)** for PR 32724 at commit [`ee3cf4b`](https://github.com/apache/spark/commit/ee3cf4b67b28e502f3a4a2092da8ed854aaa384f).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #32724:
URL: https://github.com/apache/spark/pull/32724


   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r642833622



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -63,3 +70,8 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
       LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan))
   }
 }
+
+/**
+ * ConvertToLocalRelation at AQE optimizer side.
+ */
+object AQEConvertToLocalRelation extends ConvertToLocalRelationBase

Review comment:
       avoid this rule marked as ineffective during normal optimizer




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852830389


   **[Test build #139195 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139195/testReport)** for PR 32724 at commit [`c7996bb`](https://github.com/apache/spark/commit/c7996bbdfc7af288979ea65102e7637d4c5da1a7).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852231394


   **[Test build #139165 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139165/testReport)** for PR 32724 at commit [`71cac38`](https://github.com/apache/spark/commit/71cac38b1740de26d071da3c864dd2619aefbf8c).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852831866


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139195/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852238335


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/139165/
   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852350620


   **[Test build #139170 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139170/testReport)** for PR 32724 at commit [`41b1c97`](https://github.com/apache/spark/commit/41b1c977bce081bdba2a22364a84f3215b2e6f70).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643188106



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -1373,6 +1380,31 @@ 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") {
+      Seq(
+        """
+         |SELECT t1.key, count(*) FROM testData t1
+         | JOIN (SELECT * FROM testData2 WHERE b = 0) t2 ON t1.key = t2.a

Review comment:
       So the join is used to produce an empty stage. Shall we simply use sort?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852240637


   **[Test build #139170 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139170/testReport)** for PR 32724 at commit [`41b1c97`](https://github.com/apache/spark/commit/41b1c977bce081bdba2a22364a84f3215b2e6f70).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32724:
URL: https://github.com/apache/spark/pull/32724#issuecomment-852153631


   **[Test build #139165 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139165/testReport)** for PR 32724 at commit [`71cac38`](https://github.com/apache/spark/commit/71cac38b1740de26d071da3c864dd2619aefbf8c).


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #32724: [SPARK-35585][SQL] Support propagate empty relation through project/filter

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32724:
URL: https://github.com/apache/spark/pull/32724#discussion_r643322189



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
##########
@@ -27,9 +28,15 @@ import org.apache.spark.util.Utils
  * The optimizer for re-optimizing the logical plan used by AdaptiveSparkPlanExec.
  */
 class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] {
+  private def fixedPoint =
+    FixedPoint(
+      conf.optimizerMaxIterations,

Review comment:
       I don't see a user request at least until now




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org