XiaoHongbo-Hope opened a new pull request, #8830:
URL: https://github.com/apache/paimon/pull/8830
### Purpose
Reading a `VECTOR` column through the columnar path throws:
```
java.lang.ClassCastException: ...CastedVectorColumnVector cannot be cast to
...ArrayColumnVector
at ...VectorizedColumnBatch.getArray(VectorizedColumnBatch.java:125)
at ...ColumnarRow.getArray(ColumnarRow.java:169)
at ...FlinkRowData.getArray(FlinkRowData.java:137)
```
A `VECTOR` type is exposed as `ARRAY` at the engine boundary
(`DataTypeToLogicalType` maps `VectorType` to a Flink `ArrayType`), so engines
read the column via `getArray`. However the columnar read produces a
`VecColumnVector` (e.g. `CastedVectorColumnVector` /
`ReadableVectorColumnVector`), and `VectorizedColumnBatch.getArray`
unconditionally cast it to `ArrayColumnVector`, causing the
`ClassCastException`.
Since a vector is an array (`InternalVector extends InternalArray`), read a
`VecColumnVector` column through `getVector`. This mirrors the ARRAY-vs-VECTOR
branching that `ColumnarArray` and `RowToColumnConverter` already do.
### Tests
`ColumnarRowWithVectorTest#testVectorReadAsArray` — reads a VECTOR column
via `getArray`; fails with `ClassCastException` before the fix, passes after.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]