fix: ensure nullable binary arrays return boxed type arrays instead of Object[]#2920
fix: ensure nullable binary arrays return boxed type arrays instead of Object[]#2920kishansinghifs1 wants to merge 1 commit into
Conversation
…f Object[] in BinaryStreamReader
|
Repository collaborators can run the JMH benchmark suite against this PR by commenting: Optional regression threshold override (Δ% on Time or Alloc/op; defaults to 10%): Only one benchmark run per PR is active at a time — issuing a new |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 24530a7. Configure here.
| array = new ArrayValue(itemClass == null ? Object.class : itemClass, len); | ||
| for (int i = 0; i < len; i++) { | ||
| array.set(i, readValue(itemTypeColumn)); | ||
| } |
There was a problem hiding this comment.
Nullable Variant breaks Object fallback
High Severity
The new nullable branch in readArrayItem determines array component types using itemTypeColumn.getDataType().getObjectClass(). This can mismatch the actual Java types returned by readValue for nullable Variant, unsigned, and Enum types, causing Array.set to fail with IllegalArgumentException during row decoding.
Reviewed by Cursor Bugbot for commit 24530a7. Configure here.
|
Thank you for the contribution! I will review next week. |


Summary
BinaryStreamReader.readArrayItem used Object.class as the element type for all nullable array columns, so Array(Nullable(Float64)) returned Object[] instead of Double[]. This splits the nullable check from the Variant/Dynamic/Geometry fallback and derives the correct boxed wrapper class via getObjectClass(). Added unit test to verify the component type is Double.class for Array(Nullable(Float64)).
Closes : #2846
Checklist
Delete items not relevant to your PR: