mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
Address rounding on divide and multiply when results are truncated. Testing: Manually ran some divides that should overflow, then added the results to the test. Made the decimal-test use rounding behavior by default, and now the error margin of the test has decreased. Initial perf results: Multiply is totall uninteresting so far, all implementations return the same values in the same time: +-------------------------+-----------------------------------+ | sum(l_quantity * l_tax) | sum(l_extendedprice * l_discount) | +-------------------------+-----------------------------------+ | 61202493.3700 | 114698450836.4234 | +-------------------------+-----------------------------------+ Fetched 1 row(s) in 1.13s Divide shows no regression from prior with DECIMAL_V2 off: +-----------------------------+-----------------------------------+ | sum(l_quantity / l_tax) | sum(l_extendedprice / l_discount) | +-----------------------------+-----------------------------------+ | 46178777464.523809516381723 | 61076151920731.010714279183910 | +-----------------------------+-----------------------------------+ before: Fetched 1 row(s) in 13.08s after: Fetched 1 row(s) in 13.06s And with DECIMAL_V2 on: +-----------------------------+-----------------------------------+ | sum(l_quantity / l_tax) | sum(l_extendedprice / l_discount) | +-----------------------------+-----------------------------------+ | 46178777464.523809523847285 | 61076151920731.010714285714202 | +-----------------------------+-----------------------------------+ Fetched 1 row(s) in 16.06s So the performance regression is not as bad as expected. Still, divide performance could use some work. Change-Id: Ie6bfcbe37555b74598d409c6f84f06b0ae5c4312 Reviewed-on: http://gerrit.cloudera.org:8080/6132 Reviewed-by: Dan Hecht <dhecht@cloudera.com> Tested-by: Impala Public Jenkins
6.6 KiB
6.6 KiB