Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
0.13.1
-
None
-
None
-
None
Description
The fix done on HIVE-7373 preserves the trailing zeroes from decimal values
as they are read from the table files, but when vectorization is on, these
values contain extra tralinig zeroes up to what the scale allows when aggregation
expressions are used.
Here's an example (data gotten from vector_decimal_aggregate.q):
hive> SET hive.vectorized.execution.enabled=false; hive> SELECT cint, MAX(cdecimal2) max FROM decimal_vgby GROUP BY cint HAVING COUNT(*) > 1; +------------+---------------------+--+ | cint | max | +------------+---------------------+--+ | NULL | 11160.715384615385 | | -3728 | 6984454.211097692 | | -563 | -617.5607769230769 | | 762 | 6984454.211097692 | | 6981 | 6984454.211097692 | | 253665376 | 11697.969230769231 | | 528534767 | 6984454.211097692 | | 626923679 | 11645.746153846154 | +------------+---------------------+--+ hive> SET hive.vectorized.execution.enabled=true; hive> SELECT cint, MAX(cdecimal2) max FROM decimal_vgby GROUP BY cint HAVING COUNT(*) > 1; +------------+-------------------------+--+ | cint | max2 | +------------+-------------------------+--+ | NULL | 11160.71538461538500 | | -3728 | 6984454.21109769200000 | | -563 | -617.56077692307690 | | 762 | 6984454.21109769200000 | | 6981 | 6984454.211097692 | | 253665376 | 11697.96923076923100 | | 528534767 | 6984454.21109769200000 | | 626923679 | 11645.74615384615400 | +------------+-------------------------+--+
Hive should not add trailing zeroes when aggregation functions are used.