You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shao Feng Shi (Jira)" <ji...@apache.org> on 2020/05/27 10:57:00 UTC

[jira] [Assigned] (KYLIN-1457) BigDecimalSerializer should use precision to check out of range

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

Shao Feng Shi reassigned KYLIN-1457:
------------------------------------

    Assignee:     (was: Edward Zhang)
      Labels: newbie  (was: )

> BigDecimalSerializer should use precision to check out of range
> ---------------------------------------------------------------
>
>                 Key: KYLIN-1457
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1457
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: Future
>            Reporter: Edward Zhang
>            Priority: Minor
>              Labels: newbie
>             Fix For: Future
>
>
> It is not correct to use length of byte array to judge if a value is out of range
>         byte[] bytes = value.unscaledValue().toByteArray();
>         if (bytes.length + 2 > maxLength) {
>             throw new IllegalArgumentException("'" + value + "' exceeds the expected length for type " + type);
>         }
> Because length of byte array is not exactly 1 byte per 2 decimal digits.
> Instead we should use precision to decide if the value is out of range



--
This message was sent by Atlassian Jira
(v8.3.4#803005)