[ 
https://issues.apache.org/jira/browse/HIVE-27553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ZhengBowen updated HIVE-27553:
------------------------------
    Description: 
I can reproduce this process.
{quote}{{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;}}
{quote}
*1、The following are the execution results and execution plan on Hive-1.0.1:*

!image-2023-07-31-20-40-00-679.png|width=550,height=230!

!image-2023-07-31-20-43-05-379.png|width=540,height=144!

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

!image-2023-07-31-20-40-35-050.png|width=538,height=257!

!image-2023-07-31-20-43-49-775.png|width=533,height=142!

  was:
I can reproduce this process.
{quote}{{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;}}
{quote}
*1、The following are the execution results and execution plan on Hive-1.0.1:*

!image-2023-07-31-20-40-00-679.png!

!image-2023-07-31-20-43-05-379.png!

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

!image-2023-07-31-20-40-35-050.png!

!image-2023-07-31-20-43-49-775.png!


> After upgrading from Hive1 to Hive3, Decimal computation experiences a loss 
> of precision
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-27553
>                 URL: https://issues.apache.org/jira/browse/HIVE-27553
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 3.1.3
>            Reporter: ZhengBowen
>            Priority: Major
>         Attachments: image-2023-07-31-20-40-00-679.png, 
> image-2023-07-31-20-40-35-050.png, image-2023-07-31-20-43-05-379.png, 
> image-2023-07-31-20-43-49-775.png
>
>
> I can reproduce this process.
> {quote}{{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;}}
> {quote}
> *1、The following are the execution results and execution plan on Hive-1.0.1:*
> !image-2023-07-31-20-40-00-679.png|width=550,height=230!
> !image-2023-07-31-20-43-05-379.png|width=540,height=144!
> *2、The following are the execution results and execution plan on Hive-3.1.3:*
> !image-2023-07-31-20-40-35-050.png|width=538,height=257!
> !image-2023-07-31-20-43-49-775.png|width=533,height=142!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to