You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Paul Taylor (Jira)" <ji...@apache.org> on 2022/06/01 04:25:00 UTC
[jira] [Assigned] (ARROW-16371) [JS] Empty table should provide an empty iterator
[ https://issues.apache.org/jira/browse/ARROW-16371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Taylor reassigned ARROW-16371:
-----------------------------------
Assignee: Paul Taylor
> [JS] Empty table should provide an empty iterator
> -------------------------------------------------
>
> Key: ARROW-16371
> URL: https://issues.apache.org/jira/browse/ARROW-16371
> Project: Apache Arrow
> Issue Type: Bug
> Components: JavaScript
> Reporter: Teodor Kostov
> Assignee: Paul Taylor
> Priority: Minor
>
> When a table is created without any data and an iterator is requested I would expect to get an empty iterator that just returns that it's done.
> Expected result:
> {code:json}
> {"value": null, "done": true}
> {code}
> However, the code fails in {{strideForType()}} with {{Uncaught TypeError: type2 is undefined}}.
> {code:javascript}
> schema = new arrow.Schema(dataType.children)
> data = new arrow.Table(this.schema)
> const iter = data[Symbol.iterator]()
> {code}
> It seems that the [table just creates a new vector with its data|https://github.com/apache/arrow/blob/e9481532e93e4f29a1c2c322e00f268d6cd9f534/js/src/table.ts#L227] and then the [{{strideForType}} method fails|https://github.com/apache/arrow/blob/e9481532e93e4f29a1c2c322e00f268d6cd9f534/js/src/type.ts#L652].
--
This message was sent by Atlassian Jira
(v8.20.7#820007)