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/07/05 19:35:55 UTC

[GitHub] [spark] cloud-fan opened a new pull request #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

cloud-fan opened a new pull request #33222:
URL: https://github.com/apache/spark/pull/33222


   <!--
   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.
   -->
   The `RemoveRedundantProjects` feature can conflict with the AQE broadcast threshold ([PR](https://github.com/apache/spark/pull/32391)) sometimes. After removing the project, the physical plan to logical plan link can be changed and we may have a `Project` above `LogicalQueryStage`. This breaks AQE broadcast threshold, because the stats of `Project` does not have the `isRuntime = true` flag, and thus still use the normal broadcast threshold.
   
   This PR updates `RemoveRedundantProjects` to not remove `ProjectExec` that has a different logical plan link than its child.
   
   ### 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.
   -->
   Make AQE broadcast threshold work in more cases.
   
   ### 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.
   -->
   new tests


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140676 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140676/testReport)** for PR 33222 at commit [`0c963f2`](https://github.com/apache/spark/commit/0c963f239bf5967135d2c859ac542ed6a060c780).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   @ulysses-you since 3.1 does not enable AQE by default, I didn't backport this PR. If you think it's necessary, feel free to open a backport PR, probably with a modified test case to show the problem in 3.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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140676 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140676/testReport)** for PR 33222 at commit [`0c963f2`](https://github.com/apache/spark/commit/0c963f239bf5967135d2c859ac542ed6a060c780).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       This looks risky. It makes it hard to reason about the mapping between physical and logical plans.

##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       I think we should even remove this line




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140687 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140687/testReport)** for PR 33222 at commit [`36d7142`](https://github.com/apache/spark/commit/36d7142743d388d666480c5721ae972df9c450f6).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140702 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140702/testReport)** for PR 33222 at commit [`2bfa9ab`](https://github.com/apache/spark/commit/2bfa9ab279aeec579f0cad03d5a57ba4790d6267).
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   @cloud-fan created https://github.com/apache/spark/pull/33238


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   thanks for the review, merging to master/3.2


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140681 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140681/testReport)** for PR 33222 at commit [`46b9201`](https://github.com/apache/spark/commit/46b92016c7ca7fc4a95d40fa8fb1389e9cecc438).
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       I think we should even remove this line




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140670 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140670/testReport)** for PR 33222 at commit [`1532fc7`](https://github.com/apache/spark/commit/1532fc739fa2c932059dede073726a0afd4561b1).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,9 +48,8 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
-          newPlan.setLogicalLink(child.logicalLink.get)
           newPlan

Review comment:
       just `removeProject(child, requireOrdering)`




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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






-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140676 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140676/testReport)** for PR 33222 at commit [`0c963f2`](https://github.com/apache/spark/commit/0c963f239bf5967135d2c859ac542ed6a060c780).
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140687 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140687/testReport)** for PR 33222 at commit [`36d7142`](https://github.com/apache/spark/commit/36d7142743d388d666480c5721ae972df9c450f6).
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   The root cause is the wrong mapping between physical and logical plans, and in 3.1 it causes query failures. My fix is to be safe and do not remove `ProjectExec` that may break the mapping.


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       how about use
   
   `newPlan.setLogicalLink(child.logicalLink.get)` -> `newPlan.setLogicalLink(p.logicalLink.get)` ?




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140687 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140687/testReport)** for PR 33222 at commit [`36d7142`](https://github.com/apache/spark/commit/36d7142743d388d666480c5721ae972df9c450f6).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140702 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140702/testReport)** for PR 33222 at commit [`2bfa9ab`](https://github.com/apache/spark/commit/2bfa9ab279aeec579f0cad03d5a57ba4790d6267).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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






-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140670 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140670/testReport)** for PR 33222 at commit [`1532fc7`](https://github.com/apache/spark/commit/1532fc739fa2c932059dede073726a0afd4561b1).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       how about use
   
   `newPlan.setLogicalLink(child.logicalLink.get)` -> `newPlan.setLogicalLink(p.logicalLink.get)` ?

##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,9 +48,8 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
-          newPlan.setLogicalLink(child.logicalLink.get)
           newPlan

Review comment:
       just `removeProject(child, requireOrdering)`




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140670 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140670/testReport)** for PR 33222 at commit [`1532fc7`](https://github.com/apache/spark/commit/1532fc739fa2c932059dede073726a0afd4561b1).
    * This patch **fails to build**.
    * 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140681 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140681/testReport)** for PR 33222 at commit [`46b9201`](https://github.com/apache/spark/commit/46b92016c7ca7fc4a95d40fa8fb1389e9cecc438).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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






-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   **[Test build #140681 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140681/testReport)** for PR 33222 at commit [`46b9201`](https://github.com/apache/spark/commit/46b92016c7ca7fc4a95d40fa8fb1389e9cecc438).


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


   cc @allisonwang-db @ulysses-you @viirya 


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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






-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -48,7 +48,7 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
   private def removeProject(plan: SparkPlan, requireOrdering: Boolean): SparkPlan = {
     plan match {
       case p @ ProjectExec(_, child) =>
-        if (isRedundant(p, child, requireOrdering)) {
+        if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
           val newPlan = removeProject(child, requireOrdering)
           newPlan.setLogicalLink(child.logicalLink.get)

Review comment:
       This looks risky. It makes it hard to reason about the mapping between physical and logical plans.




-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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






-- 
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: reviews-unsubscribe@spark.apache.org

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 #33222: [SPARK-36020][SQL] Check logical link in remove redundant projects

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


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


-- 
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: reviews-unsubscribe@spark.apache.org

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