[ https://issues.apache.org/jira/browse/HIVE-15406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16798002#comment-16798002 ]
Laszlo Bodor edited comment on HIVE-15406 at 3/21/19 12:21 PM: --------------------------------------------------------------- thanks for the review [~kgyrtkirk] 1. the zeros are the same as in nonvectorized execution, and it may be because - somewhere while processing the input decimal - scale/precision is not enforced 2. attached the same queries in nonvectorized mode i agree that it could be misleading to see leading zeros when the input is casted to (10,5), but for now, it could remain as a sign that it should be reviewed later (in both vec and nonvec implementation) was (Author: abstractdog): thanks for the review [~kgyrtkirk] 1. the zeros are the same as in nonvectorized execution, and it's because trunc function doesn't respect the input scale when it produces output, see: https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java#L448 HiveDecimal has also a constructor with scale parameter, but it's not used 2. attached the same queries in nonvectorized mode i agree that it could be annoying to see leading zeros when the input is casted to (10,5), but for now, it could remain as a sign that it should be reviewed later (in both vec and nonvec implementation) > Consider vectorizing the new 'trunc' function > --------------------------------------------- > > Key: HIVE-15406 > URL: https://issues.apache.org/jira/browse/HIVE-15406 > Project: Hive > Issue Type: Bug > Components: Vectorization > Affects Versions: 4.0.0 > Reporter: Matt McCline > Assignee: Laszlo Bodor > Priority: Critical > Attachments: HIVE-15406.01.patch, HIVE-15406.02.patch, > HIVE-15406.03.patch, HIVE-15406.04.patch, HIVE-15406.05.patch, > HIVE-15406.06.patch > > > Rounding function 'trunc' added by HIVE-14582. -- This message was sent by Atlassian JIRA (v7.6.3#76005)