You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2014/05/21 20:33:38 UTC
[jira] [Created] (DRILL-798) explicit casting a string to float
loses precision
Chun Chang created DRILL-798:
--------------------------------
Summary: 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
Reporter: Chun Chang
Assignee: Jinfeng Ni
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.2#6252)