Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-3820

Consider creating a literal like "D" or "BD" for representing Decimal type constants

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0
    • None
    • None

    Description

      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.

      Attachments

        1. HIVE-3820.2.patch
          7 kB
          Gunther Hagleitner
        2. HIVE-3820.D8823.1.patch
          7 kB
          Phabricator
        3. HIVE-3820.1.patch
          7 kB
          Gunther Hagleitner

        Issue Links

          Activity

            People

              hagleitn Gunther Hagleitner
              mgrover Mark Grover
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: