You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2022/09/28 22:17:00 UTC

[jira] [Resolved] (ARROW-15479) [C++] Cast fixed size list to compatible fixed size list type (other values type, other field name)

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

David Li resolved ARROW-15479.
------------------------------
    Fix Version/s: 10.0.0
       Resolution: Fixed

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

> [C++] Cast fixed size list to compatible fixed size list type (other values type, other field name)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-15479
>                 URL: https://issues.apache.org/jira/browse/ARROW-15479
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Joris Van den Bossche
>            Assignee: Kshiteej K
>            Priority: Major
>              Labels: good-second-issue, kernel, pull-request-available
>             Fix For: 10.0.0
>
>          Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> Casting a FixedSizeListArray to a compatible type but only a different field name isn't implemented:
> {code:python}
> >>> my_type = pa.list_(pa.field("element", pa.int64()), 2)
> >>> arr = pa.FixedSizeListArray.from_arrays(pa.array([1, 2, 3, 4, 5, 6]), 2)
> >>> arr.type
> FixedSizeListType(fixed_size_list<item: int64>[2])
> >>> my_type
> FixedSizeListType(fixed_size_list<element: int64>[2])
> >>> arr.cast(my_type)
> ...
> ArrowNotImplementedError: Unsupported cast from fixed_size_list<item: int64>[2] to fixed_size_list using function cast_fixed_size_list
> {code}
> While the similar operation with a variable sized list actually works:
> {code:python}
> >>> my_type = pa.list_(pa.field("element", pa.int64()))
> >>> arr = pa.array([[1, 2], [3, 4]], pa.list_(pa.int64()))
> >>> arr.type
> ListType(list<item: int64>)
> >>> arr.cast(my_type).type
> ListType(list<element: int64>)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)