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

Ran Tao commented on CALCITE-6067:
----------------------------------

my question is why you cast a string to float, but raise a *ClassCastException: 
class java.lang.Long cannot be cast to class java.lang.Float*, obviously we not 
support *cast("added" as float)*, it will raise a exception like:

{noformat}
Caused by: java.lang.NumberFormatException: For input string: "added"
{noformat}

> Avatica protobuf: casting to FLOAT data type fails
> --------------------------------------------------
>
>                 Key: CALCITE-6067
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6067
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: 1.17.0
>            Reporter: Egor Ryashin
>            Priority: Major
>              Labels: protobuf
>         Attachments: image-2023-10-23-13-45-59-828.png
>
>
> I have a strange error using Apache Druid avatica protobuf endpoint. I send 
> this query:
>  SELECT "user", 
> cast("added" as float) m3
> from "wikipedia"
> limit 10
>  
> and I get this without a stacktrace:
> ClassCastException: class java.lang.Long cannot be cast to class 
> java.lang.Float (java.lang.Long and java.lang.Float are in module java.base 
> of loader 'bootstrap')
>  
> I works with `double` though:
>  SELECT
>  cast(1.0 as double) m3
>  from "wikipedia"
>  
> The screenshot shows the exception is thrown here:
> !image-2023-10-23-13-45-59-828.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to