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

ASF GitHub Bot commented on DRILL-6421:
---------------------------------------

arina-ielchiieva commented on a change in pull request #1267: DRILL-6421: 
Refactor DecimalUtility and CoreDecimalUtility classes
URL: https://github.com/apache/drill/pull/1267#discussion_r188950847
 
 

 ##########
 File path: 
exec/vector/src/main/java/org/apache/drill/exec/util/DecimalUtility.java
 ##########
 @@ -320,25 +203,25 @@ public static void getSparseFromBigDecimal(BigDecimal 
input, ByteBuf data, int s
 
     int destIndex = nDecimalDigits - roundUp(scale) - 1;
 
-    // we use base 1 billion integer digits for out integernal representation
+    // we use base 1 billion integer digits for out internal representation
     BigDecimal base = new BigDecimal(DIGITS_BASE);
 
-    while (integerPart.compareTo(BigDecimal.ZERO) == 1) {
-        // store the modulo as the integer value
-        data.setInt(startIndex + (destIndex * INTEGER_SIZE), 
(integerPart.remainder(base)).intValue());
-        destIndex--;
-        // Divide by base 1 billion
-        integerPart = (integerPart.divide(base)).setScale(0, 
BigDecimal.ROUND_DOWN);
+    while (integerPart.compareTo(BigDecimal.ZERO) > 0) {
 
 Review comment:
   Not saying, this change is not correct but `compareTo` for BidDecimal 
returns 1.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactor DecimalUtility and CoreDecimalUtility classes
> ------------------------------------------------------
>
>                 Key: DRILL-6421
>                 URL: https://issues.apache.org/jira/browse/DRILL-6421
>             Project: Apache Drill
>          Issue Type: Task
>            Reporter: Volodymyr Vysotskyi
>            Assignee: Volodymyr Vysotskyi
>            Priority: Major
>             Fix For: 1.14.0
>
>
> After the changes, made inĀ DRILL-6094, most of the methods in 
> {{DecimalUtility}} class became unused, so they should be removed. 
> Both {{DecimalUtility}} andĀ {{CoreDecimalUtility}} are intended for the same 
> goals, so they should be merged.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to