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

Joris Van den Bossche commented on ARROW-7363:
----------------------------------------------

There is also already {{pa.concat_arrays}}, with which you can combine the 
chunks:

{code}
In [42]: chunked_array = pa.chunked_array([[1, 2], [3, 4]])                     
                                                                                
                                                   

In [43]: chunked_array                                                          
                                                                                
                                                   
Out[43]: 
<pyarrow.lib.ChunkedArray object at 0x7fa785879ea8>
[
  [
    1,
    2
  ],
  [
    3,
    4
  ]
]

In [44]: pa.concat_arrays(chunked_array.chunks)                                 
                                                                                
                                                   
Out[44]: 
<pyarrow.lib.Int64Array object at 0x7fa785824468>
[
  1,
  2,
  3,
  4
]
{code}

(which is in the end using the same C++ {{Concatenate}} functionality as 
combine_chunks)

But so maybe we could indeed expose this as a {{combine_chunks}} method on 
ChunkedArray as well.

> [Python] flatten() doesn't work on ChunkedArray
> -----------------------------------------------
>
>                 Key: ARROW-7363
>                 URL: https://issues.apache.org/jira/browse/ARROW-7363
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.15.1
>            Reporter: marc abboud
>            Priority: Major
>
> Flatten() doesn't work on ChunkedArray. It returns only the ChunkedArray in a 
> list without flattening anything.
> {code:java}
> // code placeholder
> aa = pa.array([[1],[2]])
> bb = pa.chunked_array([aa,aa])
>  
> bb.flatten()
> Out[15]:
> [<pyarrow.lib.ChunkedArray object> [ [ [ 1 ], [ 2 ] ], [ [ 1 ], [ 2 ] ] ]]
> Expected:
> [ <pyarrow.lib.Array object> [ 1, 2 ], <pyarrow.lib.Array object> [ 1, 2 ] ]
> {code}
>  



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

Reply via email to