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 2020/06/12 08:10:46 UTC

[GitHub] [spark] maropu opened a new pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

maropu opened a new pull request #28810:
URL: https://github.com/apache/spark/pull/28810


   <!--
   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'.
   -->
   
   ### 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.
   -->
   To avoid the unnecessary CNF computation for full-outer joins, this PR fixes code for filtering out full-outer joins at the entrance of the rule.
   
   ### 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.
   -->
   To mitigate optimizer overhead.
   
   ### 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.
   -->
   Existing 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.

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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123931 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123931/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123908 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123908/testReport)** for PR 28810 at commit [`6cad6c6`](https://github.com/apache/spark/commit/6cad6c60445206aa3bdc786a2e1f2dcd826af087).
    * 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] SparkQA commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123923 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123923/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124122 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124122/testReport)** for PR 28810 at commit [`6dbff0c`](https://github.com/apache/spark/commit/6dbff0c941df5935103ba2979e4b88723569b3f9).


----------------------------------------------------------------
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] gengliangwang commented on a change in pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>

Review comment:
       Nit: jt => other

##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PushCNFPredicateThroughJoin.scala
##########
@@ -53,9 +60,8 @@ object PushCNFPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelpe
             Join(newLeft, right, RightOuter, Some(joinCondition), hint)
           case LeftOuter | LeftAnti | ExistenceJoin(_) =>
             Join(left, newRight, joinType, Some(joinCondition), hint)
-          case FullOuter => j
-          case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-          case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+          case jt =>

Review comment:
       ditto




----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124122 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124122/testReport)** for PR 28810 at commit [`6dbff0c`](https://github.com/apache/spark/commit/6dbff0c941df5935103ba2979e4b88723569b3f9).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123923 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123923/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).
    * 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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124120 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124120/testReport)** for PR 28810 at commit [`f4497a6`](https://github.com/apache/spark/commit/f4497a66375531989e4f6c9c7c38457c2753e799).
    * 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 removed a comment on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124104 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124104/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124081 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124081/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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] wangyum closed pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

Posted by GitBox <gi...@apache.org>.
wangyum closed pull request #28810:
URL: https://github.com/apache/spark/pull/28810


   


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124081 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124081/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123931 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123931/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).
    * 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] AmplabJenkins commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124081 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124081/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).
    * 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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>
+          throw new IllegalStateException(s"Unexpected join type: $jt")

Review comment:
       `IllegalStateException` means unexpected code path, I think this is the standard in Java, +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] SparkQA removed a comment on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123931 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123931/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


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


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   Yea, sure.


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123923 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123923/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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] maropu commented on a change in pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>
+          sys.error(s"Unexpected join type: $jt")

Review comment:
       `AnalysisException` is mainly used for an analyzing phase? https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/AnalysisException.scala#L24
   
   yea, I know some rules in the optimizer throw `AnalysisException` though...
   ```
   (base) maropu@~/Repositories/spark/spark-master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer: (SPARK-31705 $)$grep -nr "throw" .
   ./joins.scala:187:        // `requires attributes from more than one child`, we throw firstly here for better
   ./joins.scala:189:        throw new AnalysisException("Using PythonUDF in join condition of join type" +
   ./joins.scala:206:          throw new AnalysisException("Using PythonUDF in join condition of join type" +
   ./NormalizeFloatingNumbers.scala:100:      throw new IllegalStateException("grouping/join/window partition keys cannot be map type.")
   ./NormalizeFloatingNumbers.scala:134:    case _ => throw new IllegalStateException(s"fail to normalize $expr")
   ./objects.scala:250:        throw new IllegalStateException("LambdaVariable should never has 0 as its ID.")
   ./objects.scala:255:          throw new IllegalStateException(
   ./objects.scala:264:          throw new IllegalStateException(
   ./Optimizer.scala:1345:          throw new IllegalStateException(s"Unexpected join type: $jt")
   ./Optimizer.scala:1381:          throw new IllegalStateException(s"Unexpected join type: $jt")
   ./Optimizer.scala:1436:          throw new AnalysisException(
   ./PushCNFPredicateThroughJoin.scala:64:            throw new IllegalStateException(s"Unexpected join type: $jt")
   ./ReplaceExceptWithFilter.scala:106:    throw new IllegalStateException("Leaf node is expected")
   ./ReplaceNullWithFalseInPredicate.scala:105:        throw new IllegalArgumentException(message)
   ./subquery.scala:79:            throw new AnalysisException("Found conflicting attributes " +
   ```




----------------------------------------------------------------
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] maropu commented on a change in pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>
+          sys.error(s"Unexpected join type: $jt")

Review comment:
       How about `IllegalStateException`? Throwing an exception here looks okay to me, but I personally think we need consistent handling for unexpected code pathes. I've checed how to handle this unexpected behaivour in the other optimzier rules, then I found there are some rules to use `sys.error`;
   ```
   $ grep -nr "sys.error" .
   ./Optimizer.scala:1345:          sys.error(s"Unexpected join type: $jt")
   ./Optimizer.scala:1381:          sys.error(s"Unexpected join type: $jt")
   ./PushCNFPredicateThroughJoin.scala:64:            sys.error(s"Unexpected join type: $jt")
   ./subquery.scala:458:        sys.error(s"Unexpected operator in scalar subquery: $lp")
   ./subquery.scala:496:          sys.error(s"Correlated subquery has unexpected operator $op below filter")
   ./subquery.scala:498:        case op @ _ => sys.error(s"Unexpected operator $op in correlated subquery")
   ./subquery.scala:502:    sys.error("This line should be unreachable")
   ./subquery.scala:564:              case op => sys.error(s"Unexpected operator $op in corelated subquery")
   ```
   Is it better to change them, too?




----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124122 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124122/testReport)** for PR 28810 at commit [`6dbff0c`](https://github.com/apache/spark/commit/6dbff0c941df5935103ba2979e4b88723569b3f9).
    * 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] AmplabJenkins removed a comment on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123908 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123908/testReport)** for PR 28810 at commit [`6cad6c6`](https://github.com/apache/spark/commit/6cad6c60445206aa3bdc786a2e1f2dcd826af087).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123917 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123917/testReport)** for PR 28810 at commit [`7850c2b`](https://github.com/apache/spark/commit/7850c2b58d418a9a7dba9031dbc39385884c58bb).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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] gengliangwang commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   @maropu Thanks for the improvement. Shall we update `PushPredicateThroughJoin` as well?


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   Thanks, all! Pending, Jenkins.


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124104 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124104/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).


----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   retest this please


----------------------------------------------------------------
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] gengliangwang commented on a change in pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>
+          sys.error(s"Unexpected join type: $jt")

Review comment:
       How about `AnalysisException`?




----------------------------------------------------------------
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] wangyum commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   Merged 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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123917 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123917/testReport)** for PR 28810 at commit [`7850c2b`](https://github.com/apache/spark/commit/7850c2b58d418a9a7dba9031dbc39385884c58bb).
    * 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] AmplabJenkins commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124104 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124104/testReport)** for PR 28810 at commit [`1251b68`](https://github.com/apache/spark/commit/1251b68044611148dcb840d3efa3c39ed9aee18e).
    * This patch **fails due to an unknown error code, -9**.
    * 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 commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


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


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
 
           (rightFilterConditions ++ commonFilterCondition).
             reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
-        case FullOuter => f // DO Nothing for Full Outer Join
-        case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
-        case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+        case jt =>
+          sys.error(s"Unexpected join type: $jt")

Review comment:
       since we are here, can we throw an exception instead? `sys.error` will exit the JVM IIRC




----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   cc: @gengliangwang @cloud-fan 


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   retest this please


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124120 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124120/testReport)** for PR 28810 at commit [`f4497a6`](https://github.com/apache/spark/commit/f4497a66375531989e4f6c9c7c38457c2753e799).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #124120 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/124120/testReport)** for PR 28810 at commit [`f4497a6`](https://github.com/apache/spark/commit/f4497a66375531989e4f6c9c7c38457c2753e799).


----------------------------------------------------------------
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] maropu commented on pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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






----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123917 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123917/testReport)** for PR 28810 at commit [`7850c2b`](https://github.com/apache/spark/commit/7850c2b58d418a9a7dba9031dbc39385884c58bb).


----------------------------------------------------------------
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 #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins

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


   **[Test build #123908 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123908/testReport)** for PR 28810 at commit [`6cad6c6`](https://github.com/apache/spark/commit/6cad6c60445206aa3bdc786a2e1f2dcd826af087).


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