[
https://issues.apache.org/jira/browse/ARROW-12536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dominik Moritz updated ARROW-12536:
-----------------------------------
Description:
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!
was:
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}
> [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
> Priority: Major
>
> 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.3.4#803005)