Sergio Peña created HIVE-8541: --------------------------------- Summary: Decimal values contains extra trailing zeros when vectorization is on Key: HIVE-8541 URL: https://issues.apache.org/jira/browse/HIVE-8541 Project: Hive Issue Type: Bug Affects Versions: 0.13.1 Reporter: Sergio Peña Assignee: Sergio Peña
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): {noformat} 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 | +------------+-------------------------+--+ {noformat} Hive should not add trailing zeroes when aggregation functions are used. -- This message was sent by Atlassian JIRA (v6.3.4#6332)