[ https://issues.apache.org/jira/browse/HIVE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765119#comment-13765119 ]
Mark Grover commented on HIVE-3976: ----------------------------------- Hi Xuefu, Thanks for posting the document. Overall, looks good! It's great that you are working on this. One minor question, in the document you mention "Specifically, for +/-, the result scale is s1 + s2, and for multiplication, max(s1, s2)". Did you mean the other way around (max for +/-, s1+s2 for multiplication)? In the error handling case, you mention rounding instead of using null. That definitely seems like a plausible idea. However, I think it may be a slippery slope. For example, we may be using a rounding policy here by default. This policy may not work for all users and then we may have to expose configuration/table specific options to specify such rounding policies. There might be value in masking the values that don't conform as nulls and putting the onus on the users to explicitly round them to conform to the column type. However, if mysql or another popular database has set a precedent, what you are suggesting may be ok. Big +1 on changing arithmetic operation UDFs to GenericUDFs like you and Jason already suggested. > Support specifying scale and precision with Hive decimal type > ------------------------------------------------------------- > > Key: HIVE-3976 > URL: https://issues.apache.org/jira/browse/HIVE-3976 > Project: Hive > Issue Type: Improvement > Components: Query Processor, Types > Reporter: Mark Grover > Assignee: Xuefu Zhang > Attachments: remove_prec_scale.diff > > > HIVE-2693 introduced support for Decimal datatype in Hive. However, the > current implementation has unlimited precision and provides no way to specify > precision and scale when creating the table. > For example, MySQL allows users to specify scale and precision of the decimal > datatype when creating the table: > {code} > CREATE TABLE numbers (a DECIMAL(20,2)); > {code} > Hive should support something similar too. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira