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

Decimal Arithmetic generates NULL value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.11.0
    • 0.13.0
    • Types
    • None
    • Hortonworks 1.3 running Hive 0.11.0.1.3.0.0-107

    Description

      When a decimal division is the first operation, the quotient cannot be multiplied in a subsequent calculation. Instead, a NULL is returned.

      The following yield NULL results:
      select (cast (4.53 as decimal) / cast(25.86 as decimal)) * cast(0.087 as decimal) from <tablename> limit 1;

      select cast (4.53 as decimal) / cast(25.86 as decimal) * cast(0.087 as decimal) from <tablename> limit 1;

      If we move the multiplication operation to be first, then it will successfully calculate the result.

      Attachments

        1. HIVE-5022.1.patch.txt
          1 kB
          Teddy Choi
        2. HIVE-5022.2.patch.txt
          3 kB
          Teddy Choi
        3. HIVE-5022.3.patch.txt
          8 kB
          Teddy Choi

        Issue Links

          Activity

            People

              xuefuz Xuefu Zhang
              kjsoohoo Kevin Soo Hoo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: