You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/03/27 19:26:41 UTC

[jira] [Resolved] (CALCITE-1722) Druid adapter uses un-scaled value of DECIMAL literals

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

Jesus Camacho Rodriguez resolved CALCITE-1722.
----------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.13.0

I have fixed the un-scaled problem in http://git-wip-us.apache.org/repos/asf/calcite/commit/370dfda.

I have created CALCITE-1724 to tackle the _ordering_ issue when we move to 0.9.2.

Thanks [~bslim]!

> Druid adapter uses un-scaled value of DECIMAL literals
> ------------------------------------------------------
>
>                 Key: CALCITE-1722
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1722
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.12.0
>            Reporter: slim bouguerra
>            Assignee: slim bouguerra
>             Fix For: 1.13.0
>
>
> We have 2 issue here:
> 1 Major, it is the lose of precision when converting filters with double values eg {code} value < 1.455 {code}
> For instance this is an example of wrong plan due to this bug.
> {code} 
>  explain select d_year from ssb_druid where cast(d_year as double) < 1.2221;
> OK
> Plan optimized by CBO.
> Stage-0
>   Fetch Operator
>     limit:-1
>     Select Operator [SEL_1]
>       Output:["_col0"]
>       TableScan [TS_0]
>         Output:["d_year"],properties:{"druid.query.json":"{\"queryType\":\"select\",\"dataSource\":\"ssb_druid\",\"descending\":false,\"intervals\":[\"1900-01-01T00:00:00.000/3000-01-01T00:00:00.000\"],\"filter\":{\"type\":\"bound\",\"dimension\":\"d_year\",\"upper\":\"12221\",\"upperStrict\":true,\"alphaNumeric\":true},\"dimensions\":[\"d_year\"],\"metrics\":[],\"granularity\":\"all\",\"pagingSpec\":{\"threshold\":16384,\"fromNext\":true},\"context\":{\"druid.query.fetch\":false}}","druid.query.type":"select"}
> {code}
> The second issue (Minor) is to use {code}ordering{code} instead of Alphanumeric, this is needed when comparing floats/doubles.



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