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 15:50:00 UTC

[jira] [Resolved] (ARROW-9143) [C++] RecordBatch::Slice erroneously sets non-nullable field's internal null_count to unknown

     [ https://issues.apache.org/jira/browse/ARROW-9143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes McKinney resolved ARROW-9143.
---------------------------------
    Resolution: Fixed

Issue resolved by pull request 7448
[https://github.com/apache/arrow/pull/7448]

> [C++] RecordBatch::Slice erroneously sets non-nullable field's internal null_count to unknown
> ---------------------------------------------------------------------------------------------
>
>                 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
>              Labels: pull-request-available
>             Fix For: 1.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> 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)