Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4379

Meta.Frame created with java float values in rows hits a ClassCastException in toProto()

    XMLWordPrintableJSON

    Details

      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...]
      

        Attachments

          Activity

            People

            • Assignee:
              dimas-b Dmitri Bourlatchkov
              Reporter:
              dimas-b Dmitri Bourlatchkov
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1.5h
                1.5h