You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "slim bouguerra (JIRA)" <ji...@apache.org> on 2017/03/23 20:53:41 UTC
[jira] [Created] (CALCITE-1722) Lose of double precision on
Filters.
slim bouguerra created CALCITE-1722:
---------------------------------------
Summary: Lose of double precision on Filters.
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: Julian Hyde
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)