hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phabricator (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-3820) Consider creating a literal like "D" or "BD" for representing Decimal type constants
Date Fri, 22 Feb 2013 09:32:16 GMT

     [ https://issues.apache.org/jira/browse/HIVE-3820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Phabricator updated HIVE-3820:
------------------------------

    Attachment: HIVE-3820.D8823.1.patch

hagleitn requested code review of "HIVE-3820 [jira] Consider creating a literal like "D" or
"BD" for representing Decimal type constants".

Reviewers: JIRA

HIVE-3820: Decimal literals

When the HIVE-2693 gets committed, users are going to see this behavior:

hive> select cast(3.14 as decimal) from decimal_3 limit 1;
3.140000000000000124344978758017532527446746826171875

That's intuitively incorrect but is the case because 3.14 (double) is being converted to BigDecimal
because of which there is a precision mismatch.

We should consider creating a new literal for expressing constants of Decimal type as Gunther
suggested in HIVE-2693.

TEST PLAN
  EMPTY

REVISION DETAIL
  https://reviews.facebook.net/D8823

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/literal_decimal.q
  ql/src/test/results/clientpositive/literal_decimal.q.out
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/JavaBigDecimalObjectInspector.java

MANAGE HERALD RULES
  https://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  https://reviews.facebook.net/herald/transcript/21441/

To: JIRA, hagleitn

                
> Consider creating a literal like "D" or "BD" for representing Decimal type constants
> ------------------------------------------------------------------------------------
>
>                 Key: HIVE-3820
>                 URL: https://issues.apache.org/jira/browse/HIVE-3820
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Mark Grover
>         Attachments: HIVE-3820.1.patch, HIVE-3820.D8823.1.patch
>
>
> When the HIVE-2693 gets committed, users are going to see this behavior:
> {code}
> hive> select cast(3.14 as decimal) from decimal_3 limit 1;
> 3.140000000000000124344978758017532527446746826171875
> {code}
> That's intuitively incorrect but is the case because 3.14 (double) is being converted
to BigDecimal because of which there is a precision mismatch.
> We should consider creating a new literal for expressing constants of Decimal type as
Gunther suggested in HIVE-2693.

--
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

Mime
View raw message