You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2021/11/23 18:33:00 UTC

[jira] [Commented] (ARROW-5215) [C++] Need a way to change integer size in DictBuilder and AdaptiveIntBuilder

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

Antoine Pitrou commented on ARROW-5215:
---------------------------------------

This works now:
{code:python}
>>> a = pa.array([None] * 3)
>>> a.cast(pa.dictionary(pa.int16(), pa.utf8()))
<pyarrow.lib.DictionaryArray object at 0x7f7bc6ddb3c0>

-- dictionary:
  []
-- indices:
  [
    null,
    null,
    null
  ]
>>> a.cast(pa.dictionary(pa.int16(), pa.utf8())).type
DictionaryType(dictionary<values=string, indices=int16, ordered=0>)
{code}


> [C++] Need a way to change integer size in DictBuilder and AdaptiveIntBuilder
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-5215
>                 URL: https://issues.apache.org/jira/browse/ARROW-5215
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>    Affects Versions: 0.13.0
>            Reporter: Antoine Pitrou
>            Priority: Major
>
> Currently, there's no way to choose the index type with DictionaryBuilder. Consequently, it's difficult to implement e.g. casts to a specific dictionary type (instead the DictionaryBuilder will select the smallest possible integer size for the index type).
> This will allow implementing "null to dict" casting.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)