You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/04/26 15:29:00 UTC

[jira] [Updated] (ARROW-10221) Javascript toArray() method ignores nulls on some types.

     [ https://issues.apache.org/jira/browse/ARROW-10221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ARROW-10221:
-----------------------------------
    Labels: pull-request-available  (was: )

> Javascript toArray() method ignores nulls on some types.
> --------------------------------------------------------
>
>                 Key: ARROW-10221
>                 URL: https://issues.apache.org/jira/browse/ARROW-10221
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: JavaScript
>    Affects Versions: 0.17.1
>            Reporter: Ben Schmidt
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The .toArray() javascript method of vectors includes a shortcut to return the underlying typed array; but this doesn't respect null values, and so can return the wrong number.
>  
> ```
> v = arrow.Vector.from(\{values: [1, 2, 3, 4, 5, null, 6],type: new arrow.Int32()})
> v.toArray()[5] // Incorrectly returns '0'
> v.get(5) // Correctly returns null
> ```
>  
> Solution: Eliminate the fast method, always return Javascript arrays. It might be better to keep the old method in cases where there are guaranteed no nulls.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)