drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victoria Markman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3868) Cast between binary/varbinary and timestamp should throw user friendly error
Date Mon, 05 Oct 2015 16:58:27 GMT

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

Victoria Markman commented on DRILL-3868:
-----------------------------------------

Apparently we don't support neither binary nor varbinary, see DRILL-3368

Binary type is documented (cast does not work), varbinary is not documented, works:

-- varbinary
{code}
0: jdbc:drill:schema=dfs> select cast(c1 as varbinary) from t1;
+--------------+
|    EXPR$0    |
+--------------+
| [B@52ceba73  |
| [B@232fe7e   |
| [B@61e20352  |
| [B@3d482eb2  |
| [B@4df1c78c  |
| [B@3c63e04e  |
| [B@411b3fdb  |
| [B@63fd6441  |
| null         |
| [B@10c11ab0  |
+--------------+
10 rows selected (0.286 seconds)
{code}

-- binary
{code}
0: jdbc:drill:schema=dfs> select cast(c1 as binary) from t1;
Error: SYSTEM ERROR: IllegalArgumentException: No enum constant org.apache.drill.common.types.TypeProtos.MinorType.BINARY
[Error Id: cea400a6-130d-489b-864c-6b96a9efe776 on atsqa4-133.qa.lab:31010] (state=,code=0)
{code}

> Cast between binary/varbinary and timestamp should throw user friendly error 
> -----------------------------------------------------------------------------
>
>                 Key: DRILL-3868
>                 URL: https://issues.apache.org/jira/browse/DRILL-3868
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 1.1.0, 1.2.0
>            Reporter: Victoria Markman
>
> Here is how my parquet file is defined:
> {code}
> [Wed Sep 30 11:44:33 ] # ~/parquet-tools/parquet-schema t1.parquet 
> message schema {
>   optional binary c_varchar (UTF8);
>   optional int32 c_integer;
>   optional int64 c_bigint;
>   optional float c_float;
>   optional double c_double;
>   optional binary c_date (UTF8);
>   optional binary c_time (UTF8);
>   optional int96 c_timestamp;
>   optional boolean c_boolean;
> }
> {code}
> Explicit cast: binary to timestamp
> {code}
> 0: jdbc:drill:schema=dfs> select cast(c_varchar as timestamp) from imp_t1;
> Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "0000 000000 00000" is
malformed at " 000000 00000"
> Fragment 0:0
> [Error Id: 6e3d61f4-371c-4a37-8060-56c33a289c0a on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> Explicit cast int96 --> converted to varbinary internally --> timestamp
> {code}
> 0: jdbc:drill:schema=dfs> select cast(c_timestamp as timestamp) from imp_t1;
> Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "�")��"
> Fragment 0:0
> [Error Id: 7c3599e8-8e5f-42d5-948e-96a8706cd801 on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> Implicit cast  binary ---> timestamp: should return user error
> {code}
> 0: jdbc:drill:schema=dfs> select count(*) from imp_t1  where c_varchar = timestamp
'2015-04-30 21:23:22';
> Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "0000 000000 00000" is
malformed at " 000000 00000"=
> Fragment 0:0
> [Error Id: 3fa3993a-d50f-47d3-a415-03e400396e5e on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> Implicit cast : int96 --> converted to varbinary internally --> timestamp
> {code}
> 0: jdbc:drill:schema=dfs> select count(*) from imp_t1  where c_timestamp = timestamp
'2015-04-30 21:23:22';
> Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "�")��"
> Fragment 0:0
> [Error Id: ee823a76-7ca8-43be-8ee3-e245aa72d19b on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> Please close it as duplicate if bug is already there - could not find one.



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

Mime
View raw message