drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-3128) LENGTH(..., CAST(... AS VARCHAR(0) ) ) yields ClassCastException
Date Mon, 18 May 2015 05:46:00 GMT
Daniel Barclay (Drill) created DRILL-3128:
---------------------------------------------

             Summary: 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
            Reporter: Daniel Barclay (Drill)


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)

Mime
View raw message