You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Victoria Markman (JIRA)" <ji...@apache.org> on 2015/09/30 21:00:06 UTC

[jira] [Created] (DRILL-3868) Cast between binary/varbinary and timestamp should throw user friendly error

Victoria Markman created DRILL-3868:
---------------------------------------

             Summary: 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)