You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2015/04/28 02:53:06 UTC

[jira] [Closed] (DRILL-1952) Inconsistent result with function mod() on float

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

Chun Chang closed DRILL-1952.
-----------------------------
    Assignee: Chun Chang  (was: Daniel Barclay (Drill))

won't fix.

> Inconsistent result with function mod() on float
> ------------------------------------------------
>
>                 Key: DRILL-1952
>                 URL: https://issues.apache.org/jira/browse/DRILL-1952
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 0.8.0
>            Reporter: Chun Chang
>            Assignee: Chun Chang
>
> #Fri Jan 02 21:20:47 EST 2015
> git.commit.id.abbrev=b491cdb
> mod() operation on float give inconsistent result. Test data can be accessed at https://s3.amazonaws.com/apache-drill/files/complex.json.gz
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDirMondrian> select t.sfa[1], mod(t.sfa[1], 10) sfamod from `complex.json` t limit 20;
> +------------+------------+
> |   EXPR$0   |   sfamod   |
> +------------+------------+
> | 1.01       | 1.01       |
> | 2.01       | 2.01       |
> | 3.01       | 3.01       |
> | 4.01       | 4.01       |
> | 5.01       | 5.01       |
> | 6.01       | 6.01       |
> | 7.01       | 7.01       |
> | 8.01       | 8.01       |
> | 9.01       | 9.01       |
> | 10.01      | 0.009999999999999787 |
> | 11.01      | 1.0099999999999998 |
> | 12.01      | 2.01       |
> | 13.01      | 3.01       |
> | 14.01      | 4.01       |
> | 15.01      | 5.01       |
> | 16.01      | 6.010000000000002 |
> | 17.01      | 7.010000000000002 |
> | 18.01      | 8.010000000000002 |
> | 19.01      | 9.010000000000002 |
> | 20.01      | 0.010000000000001563 |
> +------------+------------+
> 20 rows selected (0.112 seconds)
> {code}
> physical plan
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDirMondrian> explain plan for select t.sfa[1], mod(t.sfa[1], 10) sfamod from `complex.json` t limit 20;
> +------------+------------+
> |    text    |    json    |
> +------------+------------+
> | 00-00    Screen
> 00-01      Project(EXPR$0=[$0], sfamod=[$1])
> 00-02        SelectionVectorRemover
> 00-03          Limit(fetch=[20])
> 00-04            Project(EXPR$0=[ITEM($0, 1)], sfamod=[MOD(ITEM($0, 1), 10)])
> 00-05              Scan(groupscan=[EasyGroupScan [selectionRoot=/drill/testdata/complex_type/json/complex.json, numFiles=1, columns=[`sfa`[1]], files=[maprfs:/drill/testdata/complex_type/json/complex.json]]])
> {code}



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