You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org> on 2026/07/23 09:51:25 UTC
[PR] [common] Fix ClassCastException when reading a VECTOR column as ARRAY [paimon]
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [common][spark] Fix ClassCastException when reading a VECTOR column as ARRAY [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #8830:
URL: https://github.com/apache/paimon/pull/8830
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org