Skip to content

Every read of an ARRAY<DOUBLE> column throws ClassCastException (cast to the never-instantiated inner Double8Vector) #68

Description

@LuciferYang

Symptom

Reading any ARRAY<DOUBLE> column — both a plain Arrow List<Float64> and a FixedSizeList<Float64> (a Lance f64 vector column) — always fails with:

java.lang.ClassCastException: class org.apache.arrow.vector.Float8Vector cannot be cast to class
org.apache.flink.connector.lance.converter.RowDataConverter$Double8Vector
    at org.apache.flink.connector.lance.converter.RowDataConverter.readArrayData(RowDataConverter.java:280)

Root cause

The DoubleType branch of RowDataConverter.readArrayData casts the child vector to the private inner class Double8Vector — a wrapper whose javadoc literally says "alias for Float8Vector" — instead of using org.apache.arrow.vector.Float8Vector directly. The wrapper is never instantiated anywhere in the codebase; it is a leftover from an unfinished refactor. At runtime the child vector is an Arrow Float8Vector, which is unrelated to the inner class, so the cast can never succeed.

For comparison, the FloatType branch of the same method and the write path's DoubleType branch both cast to the Arrow vector directly; only this one branch was missed.

Impact

  • Every read entry point funnels into this one private method — LanceSource, LanceInputFormat, LanceAggregateSource, LanceVectorSearch — so f64 vector columns are entirely unreadable.
  • The type layer lets the query through: LanceTypeConverter documents FixedSizeList<Float64> <-> ARRAY<DOUBLE> as a supported mapping and maps both List and FixedSizeList to ArrayType, so schema validation passes and the failure only happens at scan time (accept-then-crash).
  • Affected version: 0.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions