GitHub user viirya opened a pull request:

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

    [SPARK-12904][SQL] Strength reduction for integer/decimal comparisons

    JIRA: https://issues.apache.org/jira/browse/SPARK-12904
    
    
    We can do the following strength reduction for comparisons between an 
integral column and a decimal literal:
    
    1. int_col > decimal_literal => int_col > floor(decimal_literal)
    2. int_col >= decimal_literal => int_col >= ceil(decimal_literal)
    3. int_col < decimal_literal => int_col < ceil(decimal_literal)
    4. int_col <= decimal_literal => int_col <= floor(decimal_literal)
    5. decimal_literal > int_col => ceil(decimal_literal) > int_col
    6. decimal_literal >= int_col => floor(decimal_literal) >= int_col
    7. decimal_literal < int_col => floor(decimal_literal) < int_col
    8. decimal_literal <= int_col => ceil(decimal_literal) <= int_col


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

    $ git pull https://github.com/viirya/spark-1 int-decimal-compare

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

    https://github.com/apache/spark/pull/10845.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 #10845
    
----
commit 5a96018c3d4ac193defc15ede6fbf91fe10a8f60
Author: Liang-Chi Hsieh <[email protected]>
Date:   2016-01-20T08:24:56Z

    Strength reduction for integer/decimal comparisons.

----


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