[
https://issues.apache.org/jira/browse/ARROW-2202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376958#comment-16376958
]
Brian Hulette commented on ARROW-2202:
--------------------------------------
[~paul.e.taylor] Good points. Definitely makes sense that {{toJSON()}} should
return data parse-able by {{Table.from}}. I made a new ticket for creating that
version of {{toJSON()}}. Maybe this accessor could be called
{{toObjectArray()}}?
My primary motivation for this was to be able to easily access data from a
relatively small {{Table}}, one that has been heavily filtered or aggregated
somehow, so I wasn't too concerned with exceeding memory limits. That being
said making it a generator or at least having a generator version could be
useful for large tables as well.
> [JS] Add DataFrame.toJSON
> -------------------------
>
> Key: ARROW-2202
> URL: https://issues.apache.org/jira/browse/ARROW-2202
> Project: Apache Arrow
> Issue Type: Improvement
> Components: JavaScript
> Reporter: Brian Hulette
> Priority: Major
>
> Currently, {{CountByResult}} has its own [{{toJSON}}
> method|https://github.com/apache/arrow/blob/master/js/src/table.ts#L282], but
> there should be a more general one for every {{DataFrame}}.
> {{CountByResult.toJSON}} returns:
> {code:json}
> {
> "keyA": 10,
> "keyB": 10,
> ...
> }{code}
> A more general {{toJSON}} could just return a list of objects with an entry
> for each column. For the above {{CountByResult}}, the output would look like:
> {code:json}
> [
> {value: "keyA", count: 10},
> {value: "keyB", count: 10},
> ...
> ]{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)