Files
impala/testdata/workloads/functional-query/queries/QueryTest
Zoltan Borok-Nagy 4f11bed407 IMPALA-5936: operator '%' overflows on large decimals
Suppose we have a large decimal number, which is greater
than INT_MAX. We want to calculate the modulo of this
number by 3:
BIG_DECIMAL % 3

The result of this calculation can be 0, 1, or 2.
This can fit into a decimal with precision 1.

The in-memory representation of such small decimals are
stored in int32_t in the backend. Let's call this int32_t
the result type. The backend had the invalid assumption
that it can do the calculation as well using the result type.
This assumption is true for multiplying or adding numbers,
but not for modulo.

Now the backend selects the biggest type of ['return type',
'1st operand type', '2nd operand type'] to do the calculation.

Change-Id: I2b06c8acd5aa490943e84013faf2eaac7c26ceb4
Reviewed-on: http://gerrit.cloudera.org:8080/8574
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
2017-11-28 21:11:45 +00:00
..
2016-02-19 00:03:15 -08:00
2017-05-22 00:40:04 +00:00
2014-01-08 10:48:09 -08:00
2014-06-20 13:35:10 -07:00