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

After upgrading from Hive1 to Hive3, Decimal computation experiences a loss of precision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.3, 4.0.0
    • None
    • HiveServer2

    Description

      I can reproduce this bug.

      create table decimal_test(
          id int,
          quantity decimal(38,8),
          cost decimal(38,8)
      ) stored as textfile;
       
      insert into decimal_test values(1,0.00008000, 0.00015000);
       
      select quantity * cost from decimal_test;

      1、The following are the execution results and execution plan on Hive-1.0.1:

      2、The following are the execution results and execution plan on Hive-3.1.3:

       

      Attachments

        1. image-2023-08-30-14-53-06-442.png
          83 kB
          ZhengBowen
        2. image-2023-07-31-20-43-49-775.png
          63 kB
          ZhengBowen
        3. image-2023-07-31-20-43-05-379.png
          63 kB
          ZhengBowen
        4. image-2023-07-31-20-40-35-050.png
          238 kB
          ZhengBowen
        5. image-2023-07-31-20-40-00-679.png
          564 kB
          ZhengBowen
        6. image2022-5-11_10-55-54.png
          83 kB
          ZhengBowen

        Issue Links

          Activity

            People

              bowen.zheng ZhengBowen
              bowen.zheng ZhengBowen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: