You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jacques Nadeau (JIRA)" <ji...@apache.org> on 2015/01/04 22:27:41 UTC

[jira] [Updated] (DRILL-798) explicit casting a string to float loses precision

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

Jacques Nadeau updated DRILL-798:
---------------------------------
    Fix Version/s:     (was: Future)
                   0.9.0
         Priority: Critical  (was: Major)

> explicit casting a string to float loses precision
> --------------------------------------------------
>
>                 Key: DRILL-798
>                 URL: https://issues.apache.org/jira/browse/DRILL-798
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Chun Chang
>            Assignee: Mehant Baid
>            Priority: Critical
>             Fix For: 0.9.0
>
>
> This is tested on git.commit.id.abbrev=5d7e3d3
> Consider the following query which cast a string '999999999' into float. This yielded 1.0e9 with drill which doesn't look right.
> 0: jdbc:drill:schema=dfs> select cast('999999999' as float) from data limit 1;
> +------------+
> |   EXPR$0   |
> +------------+
> | 1.0E9      |
> +------------+
> 0: jdbc:drill:schema=dfs> explain plan for select cast('999999999' as float) from data limit 1;
> +------------+------------+
> |    text    |    json    |
> +------------+------------+
> | ScreenPrel
>   SelectionVectorRemoverPrel
>     LimitPrel(fetch=[1])
>       ProjectPrel(EXPR$0=[CAST('999999999'):FLOAT NOT NULL])
>         ScanPrel(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/user/root/mondrian/data]], selectionRoot=/user/root/mondrian/data, columns=null]])
>  | {
>   "head" : {
>     "version" : 1,
>     "generator" : {
>       "type" : "ExplainHandler",
>       "info" : ""
>     },
>     "type" : "APACHE_DRILL_PHYSICAL",
>     "options" : [ ],
>     "resultMode" : "EXEC"
>   },
>   "graph" : [ {
>     "pop" : "parquet-scan",
>     "@id" : 1,
>     "entries" : [ {
>       "path" : "maprfs:/user/root/mondrian/data"
>     } ],
>     "storage" : {
>       "type" : "file",
>       "connection" : "maprfs:///",
>       "workspaces" : {
>         "default" : {
>           "location" : "/user/root/mondrian/",
>           "writable" : false,
>           "storageformat" : null
>         },
>         "home" : {
>           "location" : "/",
>           "writable" : false,
>           "storageformat" : null
>         },
>         "root" : {
>           "location" : "/",
>           "writable" : false,
>           "storageformat" : null
>         },
>         "tmp" : {
>           "location" : "/tmp",
>           "writable" : true,
>           "storageformat" : "csv"
>         }
>       },
>       "formats" : {
>         "psv" : {
>           "type" : "text",
>           "extensions" : [ "tbl" ],
>           "delimiter" : "|"
>         },
>         "csv" : {
>           "type" : "text",
>           "extensions" : [ "csv" ],
>           "delimiter" : ","
>         },
>         "tsv" : {
>           "type" : "text",
>           "extensions" : [ "tsv" ],
>           "delimiter" : "\t"
>         },
>         "parquet" : {
>           "type" : "parquet"
>         },
>         "json" : {
>           "type" : "json"
>         }
>       }
>     },
>     "format" : {
>       "type" : "parquet"
>     },
>     "selectionRoot" : "/user/root/mondrian/data"
>   }, {
>     "pop" : "project",
>     "@id" : 2,
>     "exprs" : [ {
>       "ref" : "`EXPR$0`",
>       "expr" : "cast( ('999999999' ) as FLOAT4 )"
>     } ],
>     "child" : 1,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000
>   }, {
>     "pop" : "limit",
>     "@id" : 3,
>     "child" : 2,
>     "first" : 0,
>     "last" : 1,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000
>   }, {
>     "pop" : "selection-vector-remover",
>     "@id" : 4,
>     "child" : 3,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000
>   }, {
>     "pop" : "screen",
>     "@id" : 5,
>     "child" : 4,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000
>   } ]
> } |



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