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

[jira] [Updated] (DRILL-1924) Unexpected exception in TRUNC function when unsupported data type is passed in

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

Parth Chandra updated DRILL-1924:
---------------------------------
    Assignee: Mehant Baid

> Unexpected exception in TRUNC function when unsupported data type is passed in
> ------------------------------------------------------------------------------
>
>                 Key: DRILL-1924
>                 URL: https://issues.apache.org/jira/browse/DRILL-1924
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 0.8.0
>            Reporter: Victoria Markman
>            Assignee: Mehant Baid
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> t.json
> {code}
> { "a1": 0, "b1": 0, "c1": "true",   "d1" : "2015-01-02"}
> { "a1": 0, "b1": 0, "c1": "false" , "d1" : "2015-01-03"}
> { "a1": 0, "b1": 0, "c1": "false" , "d1" : "2015-01-04"}
> { "a1": 1, "b1": 1, "c1": "true" ,  "d1" : "2015-01-05"}
> { "a1": 1, "b1": 1, "c1": "true" ,  "d1" : "2015-01-06"}
> {code}
> {code}
> 0: jdbc:drill:schema=dfs> select trunc(c1) from `t.json`;
> Query failed: Query stopped., Failure while trying to materialize incoming schema.  Errors:
> Error in expression at index -1.  Error: Missing function implementation: [castTINYINT(VARCHAR-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.. [ 8fa0b28d-da4a-4c73-81df-823033dedc35 on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> 0: jdbc:drill:schema=dfs> select trunc(cast(d1 as timestamp)) from `t.json`;
> Query failed: Query stopped., Failure while trying to materialize incoming schema.  Errors:
> Error in expression at index -1.  Error: Missing function implementation: [trunc(TIMESTAMP-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.. [ 2a6783c4-e111-47dc-ba67-a767a111e3a9 on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> 0: jdbc:drill:schema=dfs> select trunc(cast(d1 as date)) from `t.json`;
> Query failed: Query stopped., Failure while trying to materialize incoming schema.  Errors:
> Error in expression at index -1.  Error: Missing function implementation: [trunc(DATE-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.. [ 65de17df-5c57-44e0-b5ea-653d0ad6afb9 on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> It also "works" on boolean data type, whatever it means ... 
> {code}
> 0: jdbc:drill:schema=dfs> select cast(c1 as boolean) from `t.json`;
> +------------+
> |   EXPR$0   |
> +------------+
> | true       |
> | false      |
> | false      |
> | true       |
> | true       |
> +------------+
> 5 rows selected (0.066 seconds)
> {code}
> TRUNC function is listed in external documentation as math function.
> Please throw an error message when any other data type is passed in.



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