[
https://issues.apache.org/jira/browse/HIVE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763736#comment-13763736
]
Jason Dere commented on HIVE-3976:
----------------------------------
Thanks for posting the doc.
In regards to the default precision/scale behavior of DECIMAL values which have
no explicit precision/scale set, I wonder if we may be better off deviating
from the SQL standard which defines that it should be 0 scale. This has a
couple of pluses:
1) If users have existing Decimal data in Hive, applying the SQL standard
behavior means that their existing data is now truncated to integer values.
Having a default precision/scale here could allow most users to continue using
decimal as they are. Though users do have the workaround of using ALTER TABLE
to set the precision/scale of their existing decimal columns so that the values
will be read properly.
2) Having a default precision/scale might allow non-generic UDFs to continue to
work with decimal types, to some degree. If a non-generic UDF had decimal
arguments and return values with a useful default precision/scale.
Would definitely be good to see what people think on the default
precision/scale since changing to SQL compliance would mean a big change in
behavior. On the other hand if no one is using decimal then it might not matter.
> 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