You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Brian Hulette (Jira)" <ji...@apache.org> on 2019/11/11 23:38:00 UTC
[jira] [Commented] (ARROW-7109) [JS] Create table from Arrays
[ https://issues.apache.org/jira/browse/ARROW-7109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16971900#comment-16971900 ]
Brian Hulette commented on ARROW-7109:
--------------------------------------
Hey Sascha, sorry about the confusion, that notebook is based on a pretty old version of arrow JS. Since then, [~paul.e.taylor] has added a lot of syntax to make it a lot easier to build tables from JS arrays. There's an example in the [README|https://github.com/apache/arrow/tree/master/js#create-a-table-from-javascript-arrays], I also suggested a change to [~lmeyerov]'s notebook to use the new syntax: https://observablehq.com/@theneuralbit/manipulating-flat-arrays-arrow-style
Does that help?
> [JS] Create table from Arrays
> -----------------------------
>
> Key: ARROW-7109
> URL: https://issues.apache.org/jira/browse/ARROW-7109
> Project: Apache Arrow
> Issue Type: Wish
> Reporter: Sascha Hofmann
> Assignee: Brian Hulette
> Priority: Minor
>
> I am trying to generate an arrow table from JS arrays and followed the example from [here | [https://observablehq.com/@lmeyerov/manipulating-flat-arrays-arrow-style]] but I am struggling to generate different schemas, most importantly how to provide a type different then 'floatingpoint'. Right now, I have:
> {code:java}
> const data = Table.from({
> schema: {
> fields: [{name: 'a', nullable: false, children: Array(0),
> type: {name: 'floatingpoint', precision: 'SINGLE'}}]
> },
> batches: [{
> count: 10,
> columns: [{ name: 'a', count: 10, VALIDITY: [],
> DATA: Array.from({ length: 10 }, () => 'a') }]}]
> })
> {code}
> Which, of course is non-sense but I couldn't figure out how to provide the type (I tried type: Utf8 among others). In general wouldn't it be a nice to have create Table from object function?
> On another note, are there any plans to make the docs a little bit more descriptive? Happy to contribute!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)