GitHub user davies opened a pull request:

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

    [SPARK-11864] [SQL] Improve performance of max/min

    This PR has the following optimization:
    
    1) The greatest/least already does the null-check, so the `If` and `IsNull` 
are not necessary.
    
    2) In greatest/least, it should initialize the result using the first child 
(removing one block).
    
    3) For primitive types, the generated greater expression is too complicated 
(`a > b ? 1 : (a < b) ? -1 : 0) > 0`), should be as simple as `a > b`
    
    Combine these optimization, this could improve the performance of `ss_max` 
query by 30%.

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

    $ git pull https://github.com/davies/spark improve_max

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

    https://github.com/apache/spark/pull/9846.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 #9846
    
----
commit 3a23581dd058b1d7955ddc3c16f4c4dd6e4da308
Author: Davies Liu <[email protected]>
Date:   2015-11-19T21:38:28Z

    improve max/min

commit 71411199cf27043cafd03ec4ff5ca80d817c56b6
Author: Davies Liu <[email protected]>
Date:   2015-11-19T21:39:21Z

    Revert "improve max/min"
    
    This reverts commit 3a23581dd058b1d7955ddc3c16f4c4dd6e4da308.

commit 7f7e33dc981b09d6983a3003bfdf86a7d4cd0fef
Author: Davies Liu <[email protected]>
Date:   2015-11-19T21:40:30Z

    improve max/min

----


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