[
https://issues.apache.org/jira/browse/HIVE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13799431#comment-13799431
]
Xuefu Zhang commented on HIVE-3976:
-----------------------------------
Thanks for clarifying your question.
If the comment is about HIVE-5564, I think it might be better to move the
discussion there. Nevertheless, as short response to your comments:
1. The question of backward compatibility was brought up in day 1, and detailed
in the functional document. I think there is an agreement that no known
customer is seriously using decimal, and break of the backward compatibility
isn't a concern for this project. Unless you want to bring up that discussion
again, let's move forward without further concerning.
2. Internally, typeinfo object for "decimal(65,30)" is not user facing, (i.e,
when specifying column type), but for internal default when serve doesn't know
the type (for instance, the decimal type returned by non-generic udf). To
further clarify, externally user specifying "decimal" for column name, server
interprets it as "decimal(10, 0)"; internally, if server cannot determine the
exact type, then decimal(65,30) is assumed.
3. In my opinion, fixing the error in HIVE-5564 is better than assuming (65,30)
as the user default due to its usability problem. BTW, the fix could have been
included in this patch, so the "error" would not have come in the picture at
all.
I think I should put the clarification in #2 in the document as well. Let me
know if you have more questions.
> 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: New Feature
> Components: Query Processor, Types
> Affects Versions: 0.11.0
> Reporter: Mark Grover
> Assignee: Xuefu Zhang
> Fix For: 0.13.0
>
> Attachments: HIVE-3976.1.patch, HIVE-3976.2.patch, HIVE-3976.3.patch,
> HIVE-3976.4.patch, HIVE-3976.5.patch, HIVE-3976.6.patch, HIVE-3976.7.patch,
> HIVE-3976.8.patch, HIVE-3976.9.patch, HIVE-3976.patch, 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 was sent by Atlassian JIRA
(v6.1#6144)