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

Vitalii Diravka commented on ARROW-61:
--------------------------------------

[~lfz_carlos] This is adjustScaleMultiply(long input, int factor) method. I 
have already mentioned where it is in drill.
In apache arrow this is org/apache/arrow/vector/util/DecimalUtility.java class.
{code}
public static long adjustScaleMultiply(long input, int factor) {
      int index = Math.abs(factor);
      assert index >= 0 && index < scale_long_constants.length;
      if (factor >= 0) {
        return input * scale_long_constants[index];
      } else {
        return input / scale_long_constants[index];
      }
    }
{code}

> Method can return the value bigger than long MAX_VALUE
> ------------------------------------------------------
>
>                 Key: ARROW-61
>                 URL: https://issues.apache.org/jira/browse/ARROW-61
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java - Vectors
>         Environment: Apache Drill, Apache Arrow
>            Reporter: Vitalii Diravka
>              Labels: adjustScale, arrow, decimal
>
> Method org.apache.drill.exec.util.DecimalUtility.adjustScaleMultiply(long 
> input, int factor) can return the value bigger than long max value.
> For example by comparison two decimal18 values 9223372036854775807 and 0.001. 
> To adjust first value scale this method should return 9223372036854775807 * 
> 1000 - bigger than long max value.
> Class DecimalUtility.java will be a part of org.apache.arrow after renaming 
> described in [DRILL-4455 Depend on Apache Arrow for Vector and Memory| 
> https://issues.apache.org/jira/browse/DRILL-4455]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to