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

Issue in decimal multiplication

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Types
    • Labels:
      None

      Description

      CREATE TABLE test (a DECIMAL(38,18), b DECIMAL(38,18));
      INSERT OVERWRITE TABLE test VALUES (20, 20);
      SELECT a*b from test
      

      The returned result is NULL (instead of 400)
      It is because Hive adds the scales from operands and the type for a*b is set to decimal (38, 36). Hive could not handle this case properly (e.g. by rounding)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ctang Chaoyu Tang
                Reporter:
                ctang Chaoyu Tang
              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: