You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Zhong Yanghong (Jira)" <ji...@apache.org> on 2020/01/02 09:16:00 UTC

[jira] [Updated] (KYLIN-4325) ”Value not exists“ when invoke getIdFromValue() for decimal field during cube building

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

Zhong Yanghong updated KYLIN-4325:
----------------------------------
    Description: 
For decimal field, the following logic in *SelfDefineSortableKey* is not correct:
{code}
public void init(Text key, byte typeId) {
        this.typeId = typeId;
        this.rawKey = key;
        if (isNumberFamily()) {
            String valueStr = new String(key.getBytes(), 1, key.getLength() - 1, StandardCharsets.UTF_8);
            if (isIntegerFamily()) {
                this.keyInObj = Long.parseLong(valueStr);
            } else {
                this.keyInObj = Double.parseDouble(valueStr);
            }
        } else {
            this.keyInObj = key;
        }
    }
{code}
Since the result of Double.valueOf("206779569545636097").toString() == "206779569545636097" is false.

> ”Value not exists“ when invoke getIdFromValue() for decimal field during cube building
> --------------------------------------------------------------------------------------
>
>                 Key: KYLIN-4325
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4325
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Job Engine
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>
> For decimal field, the following logic in *SelfDefineSortableKey* is not correct:
> {code}
> public void init(Text key, byte typeId) {
>         this.typeId = typeId;
>         this.rawKey = key;
>         if (isNumberFamily()) {
>             String valueStr = new String(key.getBytes(), 1, key.getLength() - 1, StandardCharsets.UTF_8);
>             if (isIntegerFamily()) {
>                 this.keyInObj = Long.parseLong(valueStr);
>             } else {
>                 this.keyInObj = Double.parseDouble(valueStr);
>             }
>         } else {
>             this.keyInObj = key;
>         }
>     }
> {code}
> Since the result of Double.valueOf("206779569545636097").toString() == "206779569545636097" is false.



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