[ 
https://issues.apache.org/jira/browse/HIVE-16311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15958929#comment-15958929
 ] 

Colin Ma commented on HIVE-16311:
---------------------------------

[~mmccline], thanks for your comments. Some test cases like 
*1234567.8901234560*/9 are failed. These failed tests have the similar 
character, the trailing zeroes are removed. This make the formula *max(6, s1 + 
p2 + 1)* in division returned the incorrect result. You can check my previous 
comments for the detail explanation.
The new member fastTrailingZero is an experiment solution to "remember" the 
original number of trailing zeroes, and use this in the division. I agree it's 
not part of the current design for HiveDecimal.
I'll try other solution to solve this trailing zeroes problem in division.

> Improve the performance for FastHiveDecimalImpl.fastDivide
> ----------------------------------------------------------
>
>                 Key: HIVE-16311
>                 URL: https://issues.apache.org/jira/browse/HIVE-16311
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 2.2.0
>            Reporter: Colin Ma
>            Assignee: Colin Ma
>             Fix For: 3.0.0
>
>         Attachments: HIVE-16311.001.patch, HIVE-16311.002.patch, 
> HIVE-16311.003.patch, HIVE-16311.004.patch, HIVE-16311.005.patch, 
> HIVE-16311.withTrailingZero.patch
>
>
> FastHiveDecimalImpl.fastDivide is poor performance when evaluate the 
> expression as 12345.67/123.45
> There are 2 points can be improved:
> 1. Don't always use HiveDecimal.MAX_SCALE as scale when do the 
> BigDecimal.divide.
> 2. Get the precision for BigInteger in a fast way if possible.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to