You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2016/07/06 04:26:11 UTC

[jira] [Commented] (DRILL-1959) Issues with explicit casts to TINYINT, SMALLINT & REAL

    [ https://issues.apache.org/jira/browse/DRILL-1959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363747#comment-15363747 ] 

Paul Rogers commented on DRILL-1959:
------------------------------------

SMALLINT, TINYINT are still not working:

SELECT CAST(`index` AS TINYINT), CAST(`value` AS FLOAT) FROM `local`.`root`.`int_16b.parquet`

org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION ERROR: TINYINT is not supported See Apache Drill JIRA: DRILL-1959 [Error Id: 9331e5dd-1f9a-451e-8c5f-dc7c6b87a732 on 172.30.1.28:31010]

SELECT CAST(`index` AS SMALLINT), CAST(`value` AS FLOAT) FROM `local`.`root`.`int_16b.parquet`

org.apache.drill.common.exceptions.UserRemoteException: UNSUPPORTED_OPERATION ERROR: SMALLINT is not supported See Apache Drill JIRA: DRILL-1959 [Error Id: 2cf6f003-76ce-4b23-9604-2f1f73a99a15 on 172.30.1.28:31010]

SELECT CAST(`index` AS INTEGER), CAST(`value` AS FLOAT) FROM `local`.`root`.`int_16b.parquet`

EXPR$0 EXPR$1
1	0.0
2	-1.0
3	1.0
4	-32768.0
5	32767.0

> Issues with explicit casts to TINYINT, SMALLINT & REAL
> ------------------------------------------------------
>
>                 Key: DRILL-1959
>                 URL: https://issues.apache.org/jira/browse/DRILL-1959
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Data Types
>            Reporter: Abhishek Girish
>             Fix For: Future
>
>
> *The following have Issues:*
> > create table tiny1 as select cast(1 as *tinyint*) from sys.options limit 1;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | false      | *Error: Unable to convert the value of 1 and type TINYINT to a Drill constant expression.* |
> +------------+------------+
> 1 row selected (0.055 seconds)
> > create table small1 as select cast(1 as *smallint*) from sys.options limit 1;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | false      | *Error: Unable to convert the value of 1 and type SMALLINT to a Drill constant expression.* |
> +------------+------------+
> 1 row selected (0.055 seconds)
> *The following work:*
> > create table int1 as select cast(1 as *int*) from sys.options limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.172 seconds)
> > create table big1 as select cast(1 as *bigint*) from sys.options limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.195 seconds)
> > create table float1 as select cast(1 as *float*) from sys.options limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.174 seconds)
> 0: jdbc:drill:zk=10.10.103.34:5181> create table double1 as select cast(1 as *double*) from sys.options limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.153 seconds)
> 0: jdbc:drill:zk=10.10.103.34:5181> create table decimal1 as select cast(1 as *decimal(1,1)*) from sys.options limit 1;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.159 seconds)



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