diff options
author | Davies Liu <davies@databricks.com> | 2015-08-10 13:55:11 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-08-10 13:55:11 -0700 |
commit | c4fd2a242228ee101904770446e3f37d49e39b76 (patch) | |
tree | 63bba4305457fefbcfc11c8311c736d4be4267e4 /ec2/spark_ec2.py | |
parent | fe2fb7fb7189d183a4273ad27514af4b6b461f26 (diff) | |
download | spark-c4fd2a242228ee101904770446e3f37d49e39b76.tar.gz spark-c4fd2a242228ee101904770446e3f37d49e39b76.tar.bz2 spark-c4fd2a242228ee101904770446e3f37d49e39b76.zip |
[SPARK-9759] [SQL] improve decimal.times() and cast(int, decimalType)
This patch optimize two things:
1. passing MathContext to JavaBigDecimal.multiply/divide/reminder to do right rounding, because java.math.BigDecimal.apply(MathContext) is expensive
2. Cast integer/short/byte to decimal directly (without double)
This two optimizations could speed up the end-to-end time of a aggregation (SUM(short * decimal(5, 2)) 75% (from 19s -> 10.8s)
Author: Davies Liu <davies@databricks.com>
Closes #8052 from davies/optimize_decimal and squashes the following commits:
225efad [Davies Liu] improve decimal.times() and cast(int, decimalType)
Diffstat (limited to 'ec2/spark_ec2.py')
0 files changed, 0 insertions, 0 deletions