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/01/16 17:29:00 UTC

[jira] [Comment Edited] (ARROW-12536) [JS] Construct tables from JavaScript types

    [ https://issues.apache.org/jira/browse/ARROW-12536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17476847#comment-17476847 ] 

Dominik Moritz edited comment on ARROW-12536 at 1/16/22, 5:28 PM:
------------------------------------------------------------------

Done in https://github.com/apache/arrow/pull/10371. For now, we only support the columnar format. 


was (Author: domoritz):
Done in https://github.com/apache/arrow/pull/10371

> [JS] Construct tables from JavaScript types
> -------------------------------------------
>
>                 Key: ARROW-12536
>                 URL: https://issues.apache.org/jira/browse/ARROW-12536
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: JavaScript
>            Reporter: Dominik Moritz
>            Assignee: Dominik Moritz
>            Priority: Major
>             Fix For: 7.0.0
>
>
> Right now, Arrow has no automatic type inference for JavaScript types, so I think we would need to add that. 
> {code:javascript}
> // Convert from JS types automatically
> const t = Arrow.Table.from({
> 	Country: ["USA", "Canada", "Mexico"],
> 	GDP: [123, 234, 345],
> })
> // I'd also like Arrow to support other common JS table formats:
> const t = Arrow.Table.from([
> 	{Country: "USA", GDP: 123},
> 	{Country: "Canada", GDP: 234},
> 	{Country: "Mexico", GDP: 345},
> ])
> const t = Arrow.Table.from([
> 	["Country", "GDP"],
> 	["USA", 123],
> 	["Canada", 234],
> 	["Mexico", 345],
> ])
> {code}
> Thanks to Thiago for the suggestions!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)