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

Chris Westin updated DRILL-3128:
--------------------------------
    Assignee: Daniel Barclay (Drill)

> LENGTH(..., CAST(... AS VARCHAR(0) ) ) yields ClassCastException
> ----------------------------------------------------------------
>
>                 Key: DRILL-3128
>                 URL: https://issues.apache.org/jira/browse/DRILL-3128
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>             Fix For: 1.2.0
>
>
> Trying to make a function call with a function name of "{{LENGTH}}", with two 
> arguments, and with the second argument being a cast expression having a 
> target type of {{VARCHAR(0)}} yields a {{ClassCastException}} (at least for 
> several cases of source expression):
> {noformat}
> 0: jdbc:drill:zk=local> SELECT LENGTH(1, CAST('x' AS VARCHAR(0) ) ) FROM 
> INFORMATION_SCHEMA.CATALOGS;
> Error: SYSTEM ERROR: java.lang.ClassCastException: 
> org.apache.drill.common.expression.CastExpression cannot be cast to 
> org.apache.drill.common.expression.ValueExpressions$QuotedString
> [Error Id: 1860730b-b69b-4400-bb2c-935a56aa456e on dev-linux2:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> SELECT LENGTH(1, CAST(1 AS VARCHAR(0) ) ) FROM 
> INFORMATION_SCHEMA.CATALOGS;
> Error: SYSTEM ERROR: java.lang.ClassCastException: 
> org.apache.drill.common.expression.CastExpression cannot be cast to 
> org.apache.drill.common.expression.ValueExpressions$QuotedString
> [Error Id: 476c4848-4b53-4c1e-9005-2bab3a2a91a4 on dev-linux2:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> SELECT LENGTH(1, CAST(NULL AS VARCHAR(0) ) ) FROM 
> INFORMATION_SCHEMA.CATALOGS;
> Error: SYSTEM ERROR: java.lang.ClassCastException: 
> org.apache.drill.common.expression.TypedNullConstant cannot be cast to 
> org.apache.drill.common.expression.ValueExpressions$QuotedString
> [Error Id: d888a336-2b18-45d9-a5e8-f4c2406a292e on dev-linux2:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> 
> {noformat}
> This case (not with "{{VARCHAR(0)}}") also yields a {{ClassCastException}}:
> {noformat}
> 0: jdbc:drill:zk=local> SELECT LENGTH(1, CAST(1 AS VARCHAR(2) ) ) FROM 
> INFORMATION_SCHEMA.CATALOGS;
> Error: SYSTEM ERROR: java.lang.ClassCastException: 
> org.apache.drill.common.expression.CastExpression cannot be cast to 
> org.apache.drill.common.expression.ValueExpressions$QuotedString
> [Error Id: 04bd6cb1-2dd7-4938-ab9b-4d460aaaf05f on dev-linux2:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> 
> {noformat}



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

Reply via email to