[
https://issues.apache.org/jira/browse/CALCITE-6067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778630#comment-17778630
]
Ran Tao commented on CALCITE-6067:
----------------------------------
Generally speaking, the logic of avatica cast float expects that your data is
float (so that the forced casting can be successful), so the question is why
this value is still long when it reaches avatica's cast?
> 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)