spark-instrumented-optimizer/sql/catalyst/src
Davies Liu ee21407747 [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%.

Author: Davies Liu <davies@databricks.com>

Closes #9846 from davies/improve_max.
2015-11-19 17:14:10 -08:00
..
main [SPARK-11864][SQL] Improve performance of max/min 2015-11-19 17:14:10 -08:00
test [SPARK-11750][SQL] revert SPARK-11727 and code clean up 2015-11-19 12:54:25 -08:00