[ https://issues.apache.org/jira/browse/ARROW-15705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Li reassigned ARROW-15705: -------------------------------- Assignee: Alfred Mountfield > [JavaScript] Structs don't append nulls properly > ------------------------------------------------ > > Key: ARROW-15705 > URL: https://issues.apache.org/jira/browse/ARROW-15705 > Project: Apache Arrow > Issue Type: Bug > Components: JavaScript > Affects Versions: 7.0.0 > Reporter: Alfred Mountfield > Assignee: Alfred Mountfield > Priority: Major > Labels: pull-request-available > Fix For: 8.0.0 > > Time Spent: 6h 40m > Remaining Estimate: 0h > > 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: > {code:javascript} > public set(index: number, value: T['TValue'] | TNull) { > if (this.setValid(index, this.isValid(value))) { > this.setValue(index, value); > } > return this; > } > {code} > > 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 -- This message was sent by Atlassian Jira (v8.20.7#820007)