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

Issue in decimal multiplication

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Types
    • 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

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

              Dates

                Created:
                Updated: