You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Malthe Borch (Jira)" <ji...@apache.org> on 2021/03/29 17:00:00 UTC

[jira] [Comment Edited] (ARROW-12099) [Python] Explode array column

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

Malthe Borch edited comment on ARROW-12099 at 3/29/21, 4:59 PM:
----------------------------------------------------------------

What I can perhaps add is that I imagine an API such as:
{code:python}
table.explode("a")      # This would unroll the "a" array, but leave any other array as it is.
table.explode("a, "b")  # This would unroll the provided columns, "zipping" them.
{code}
That is, the interface would work strictly with already existing array columns.


was (Author: malthe):
What I can perhaps add is that I imagine an API such as:
{code:java}
table.explode("a")      # This would unroll the "a" array, but leave any other array as it is.
table.explode("a, "b")  # This would "zip" the provided columns.
{code}
That is, the interface would work strictly with already existing array columns.

> [Python] Explode array column
> -----------------------------
>
>                 Key: ARROW-12099
>                 URL: https://issues.apache.org/jira/browse/ARROW-12099
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Malthe Borch
>            Priority: Major
>
> In Apache Spark, [explode|https://spark.apache.org/docs/latest/api/sql/index.html#explode] separates the elements of an array column (or expression) into multiple row.
> Note that each explode works at the top-level only (not recursively).
> This would also work with the existing [flatten|https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.flatten] method to allow fully unnesting a [pyarrow.StructArray|https://arrow.apache.org/docs/python/generated/pyarrow.StructArray.html#pyarrow-structarray].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)