GitHub user viirya opened a pull request:

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

    [SQL] Don't add inferred redundant isnotnull condition from constraints

    ## What changes were proposed in this pull request?
    
    In `Optimizer`, we will infer additional conditions from `Filter`'s 
constraints which include `IsNotNull`. Some inferred `IsNotNull`s are useful 
because they can be short circuit for other predicates which refer the same 
attributes. But for an `IsNotNull` condition, we also infer other `IsNotNull` 
from it. Those `IsNotNull`s are redundant. We don't need to include them.
    
    E.g., for a condition like `IsNotNull(a + Rand())`, an additional 
`IsNotNull(a)` will be added into `Filter`'s condition. So we need to evaluate 
`IsNotNull(a + Rand()) && IsNotNull(a)`. Actually we don't need `IsNotNull(a)` 
because it is guaranteed by the original `IsNotNull(a + Rand())`.
    
    ## How was this patch tested?
    
    Jenkins tests.
    
    Please review 
https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark before 
opening a pull request.


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

    $ git pull https://github.com/viirya/spark-1 fix-inferred-isnotnull-cond

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

    https://github.com/apache/spark/pull/15653.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 #15653
    
----
commit 5820dfc6cb44d5dfb4713491a897e73b3e8a72e0
Author: Liang-Chi Hsieh <[email protected]>
Date:   2016-10-20T08:53:04Z

    Don't inferred redundant isnotnull condition from constraints.

commit 86443c483bc7a7dc4ddc852bb8674431e34bc946
Author: Liang-Chi Hsieh <[email protected]>
Date:   2016-10-27T02:26:54Z

    Merge remote-tracking branch 'upstream/master' into 
fix-inferred-isnotnull-cond

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to