Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
7.0.0
Description
If you have a StructBuilder, then the `set` method (which is inherited from `Builder`) on it will modify the null-bitmap and then return directly due to this snippet:
public set(index: number, value: T['TValue'] | TNull) { if (this.setValid(index, this.isValid(value))) { this.setValue(index, value); } return this; }
I believe this breaks the spec, as it results in the children arrays not having their lengths and null-counts increased. (At least the Rust implementation expects child arrays to be the same length as their parent struct array, and the spec seems to imply that's a requirement)
I think there's an easy fix which would be to call `this.setValue` for `StructBuilder`s regardless of `this.isValid(value)`
Related to https://issues.apache.org/jira/browse/ARROW-15651
Attachments
Issue Links
- fixes
-
ARROW-15651 [JavaScript] Structs incorrectly initialise null values
- Resolved
- links to