You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/12/12 00:51:53 UTC

[GitHub] spark pull request #19947: [SPARK-22759] [SQL] Filters can be combined iff b...

GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/19947

    [SPARK-22759] [SQL] Filters can be combined iff both are deterministic

    ## What changes were proposed in this pull request?
    The query execution/optimization does not guarantee the expressions are evaluated in order. We only can combine them if and only if both are deterministic. We need to update the optimizer rule: CombineFilters.
    
    ## How was this patch tested?
    Updated the existing tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark combineFilters

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/19947.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19947
    
----
commit e726f548478c769c061a52ead12948239792a404
Author: gatorsmile <ga...@gmail.com>
Date:   2017-12-12T00:49:09Z

    fix.

----


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    retest this please


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    LGTM


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84744/
    Test FAILed.


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    cc @gengliangwang @cloud-fan 


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    Thanks! Merged to master.


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    **[Test build #84744 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84744/testReport)** for PR 19947 at commit [`e726f54`](https://github.com/apache/spark/commit/e726f548478c769c061a52ead12948239792a404).


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84778/
    Test PASSed.


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    **[Test build #84778 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84778/testReport)** for PR 19947 at commit [`e726f54`](https://github.com/apache/spark/commit/e726f548478c769c061a52ead12948239792a404).


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    Merged build finished. Test FAILed.


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    **[Test build #84744 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84744/testReport)** for PR 19947 at commit [`e726f54`](https://github.com/apache/spark/commit/e726f548478c769c061a52ead12948239792a404).
     * This patch **fails SparkR unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark pull request #19947: [SPARK-22759] [SQL] Filters can be combined iff b...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/19947


---

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


[GitHub] spark pull request #19947: [SPARK-22759] [SQL] Filters can be combined iff b...

Posted by gengliangwang <gi...@git.apache.org>.
Github user gengliangwang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19947#discussion_r156250376
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala ---
    @@ -695,7 +695,9 @@ object CombineUnions extends Rule[LogicalPlan] {
      */
     object CombineFilters extends Rule[LogicalPlan] with PredicateHelper {
       def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    -    case Filter(fc, nf @ Filter(nc, grandChild)) =>
    +    // The query execution/optimization does not guarantee the expressions are evaluated in order.
    +    // We only can combine them if and only if both are deterministic.
    +    case Filter(fc, nf @ Filter(nc, grandChild)) if fc.deterministic && nc.deterministic =>
    --- End diff --
    
    if `nc` is deterministic and `fc` is non-deterministic, I think we can still combine `nc` with part of `fc` (partitioned by deterministic)


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

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


---

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


[GitHub] spark issue #19947: [SPARK-22759] [SQL] Filters can be combined iff both are...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19947
  
    Merged build finished. Test PASSed.


---

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