apache / apache/arrow

[C++][Compute] Function 'utf8_trim' has no kernel matching input types (dictionary<values=string, indices=int64, ordered=0>)

Open
#35,815 2 comments 0 reactions 1 assignee Claimed by @NathanChung4 View on GitHub
Component: C++ good-second-issue Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

Arrow compute function `utf8_trim` doesn't support dictionary array:

```
File ~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/_compute.pyx:367, in pyarrow._compute.Function.call()

File ~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()

File ~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status()

ArrowNotImplementedError: Function 'utf8_trim' has no kernel matching input types (dictionary)
```

Reproduction script:
```python
da = pa.DictionaryArray.from_arrays(pa.array([1,2,1,2,1,2,0,0]), pa.array(["abc", "b", "a"]))
pc.utf8_trim(da, characters="bc")
```

Decode DictionaryArray into StringArray will work.

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.