Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/8833 )

Change subject: IMPALA-6300: Fix decimal modulo overflow
......................................................................

IMPALA-6300: Fix decimal modulo overflow

In order to compute the modulo of two decimals, we need to bring the
underlying datatype to the same scale first. It turns out we could
overflow when scaling up one of the values.

In this patch we fix the problem by using a larger data type when we
detect that the scaled up value will not fit into the original data
type.

Testing:
- Added some expr tests that reproduce the issue.

Change-Id: I27c7f25f68353c19c315e1639311ec06b2dea686
Reviewed-on: http://gerrit.cloudera.org:8080/8833
Reviewed-by: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Tested-by: Impala Public Jenkins
---
M be/src/benchmarks/overflow-benchmark.cc
M be/src/exprs/expr-test.cc
M be/src/runtime/decimal-value.h
M be/src/runtime/decimal-value.inline.h
M be/src/util/bit-util.h
M be/src/util/decimal-util.h
6 files changed, 128 insertions(+), 135 deletions(-)

Approvals:
  Taras Bobrovytsky: Looks good to me, approved
  Impala Public Jenkins: Verified

--
To view, visit http://gerrit.cloudera.org:8080/8833
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I27c7f25f68353c19c315e1639311ec06b2dea686
Gerrit-Change-Number: 8833
Gerrit-PatchSet: 7
Gerrit-Owner: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Zach Amsden <zams...@cloudera.com>

Reply via email to