You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Wes McKinney (Jira)" <ji...@apache.org> on 2020/06/16 12:58:00 UTC

[jira] [Commented] (ARROW-9143) [Python] Segfault in dictionary_encode after RecordBatch.slice

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

Wes McKinney commented on ARROW-9143:
-------------------------------------

Confirmed on master. Having a look

> [Python] Segfault in dictionary_encode after RecordBatch.slice
> --------------------------------------------------------------
>
>                 Key: ARROW-9143
>                 URL: https://issues.apache.org/jira/browse/ARROW-9143
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.17.1
>         Environment: linux, pyarrow 0.17.1 installed with pipenv
>            Reporter: Benedict Hutchings
>            Assignee: Wes McKinney
>            Priority: Major
>             Fix For: 1.0.0
>
>
> A segfault is triggered by calling dictionary_encode on a column after slicing a Recordbatch:
> {code:java}
> import pyarrow as pa
> print(pa.__version__)
> array = pa.array(['foo', 'bar', 'baz'])
> batch = pa.RecordBatch.from_arrays([array], names=['a'])
> batch.column(0).dictionary_encode() ### works fine
> sub_batch = batch.slice(1)
> sub_batch.column(0).dictionary_encode() ### segfault
> {code}
> Slicing the underlying array and dictionary_encoding works as expected:
> {code:java}
> array.slice(1).dictionary_encode()
> {code}
> For what it's worth, this can be worked around by converting the sub_batch to and from a table with:
> {code:java}
> happy_sub_batch = pa.Table.from_batches([sub_batch]).to_batches()[0]
> happy_sub_batch.column(0).dictionary_encode() ### works fine
> {code}



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