Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.17.0
Description
Use case:
- Custom Meta implementation
- Meta.Frame.create(offset, done, rows) is called with a row (a List) containing a java Float value
- Note: the float value is fetched from Apache Cassandra, which has 32-bit float types (unlike SQL).
- Related email discussion
- The Frame is serialized by calling its .toProto() method
- ClassCastException occurs
Exception snippet:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Float at org.apache.calcite.avatica.remote.TypedValue.writeToProtoWithType(TypedValue.java:600) at org.apache.calcite.avatica.remote.TypedValue.toProto(TypedValue.java:805) at org.apache.calcite.avatica.Meta$Frame.serializeScalar(Meta.java:991) at org.apache.calcite.avatica.Meta$Frame.parseColumn(Meta.java:977) at org.apache.calcite.avatica.Meta$Frame.toProto(Meta.java:942) at org.apache.calcite.avatica.remote.Service$FetchResponse.serialize(Service.java:1468) [...snip...]