You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dominik Moritz (Jira)" <ji...@apache.org> on 2022/04/18 14:42:00 UTC
[jira] [Resolved] (ARROW-15705) [JavaScript] Structs don't append nulls properly
[ https://issues.apache.org/jira/browse/ARROW-15705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dominik Moritz resolved ARROW-15705.
------------------------------------
Fix Version/s: 8.0.0
Resolution: Fixed
Issue resolved by pull request 12451
[https://github.com/apache/arrow/pull/12451]
> [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
> Priority: Major
> Labels: pull-request-available
> Fix For: 8.0.0
>
> Time Spent: 6.5h
> 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.1#820001)