GitHub user dongjoon-hyun opened a pull request:

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

    [SPARK-14029][SQL] Improve BooleanSimplification optimization by 
implementing `Not` canonicalization.

    ## What changes were proposed in this pull request?
    
    Currently, **BooleanSimplification** optimization can handle the following 
cases.
    * a && (!'a || 'b ) ==> 'a && 'b
    * a && ('b || !'a ) ==> 'a && 'b
    
    However, it can not handle the followings cases since those equations fails 
at the comparisons between their canonicalized forms.
    * a < 1 && (!('a < 1) || 'b) ==> ('a < 1) && 'b
    * a <= 1 && (!('a <= 1) || 'b) ==> ('a <= 1) && 'b
    * a > 1 && (!('a > 1) || 'b) ==> ('a > 1) && 'b
    * a >= 1 && (!('a >= 1) || 'b) ==> ('a >= 1) && 'b
    
    This PR implements the above cases and also the followings, too.
    * a < 1 && ('a >= 1 || 'b ) ==> ('a < 1) && 'b
    * a <= 1 && ('a > 1 || 'b ) ==> ('a <= 1) && 'b
    * a > 1 && (('a <= 1) || 'b) ==> ('a > 1) && 'b
    * a >= 1 && (('a < 1) || 'b) ==> ('a >= 1) && 'b
    
    ## How was this patch tested?
    
    Pass the Jenkins tests including new test cases in BooleanSimplicationSuite.

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

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-14029

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

    https://github.com/apache/spark/pull/11851.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 #11851
    
----
commit 6e63f8a918a1dc0d6e425a52150812e66d61f657
Author: Dongjoon Hyun <dongj...@apache.org>
Date:   2016-03-20T10:29:05Z

    [SPARK-14029][SQL] Improve BooleanSimplification optimization by 
implementing `Not` canonicalization.

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to