Skip to content

[C++] Implement casting to dictionary type (dictionary_encode as a cast) #33171

@asfimport

Description

@asfimport

We can cast dictionary(string, X) to string, but not the other way around.

> Array$create(c("a", "b"))$cast(dictionary(int32(), string()))
Error: NotImplemented: Unsupported cast from string to dictionary using function cast_dictionary
/Users/willjones/Documents/arrows/arrow/cpp/src/arrow/compute/function.cc:249  func.DispatchBest(&in_types)

> Array$create(as.factor(c("a", "b")))$cast(string())
Array
<string>
[
  "a",
  "b"
]

Reporter: Will Jones / @wjones127

Related issues:

Note: This issue was originally created as ARROW-17963. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions