You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "chaokunyang (via GitHub)" <gi...@apache.org> on 2023/04/06 11:04:12 UTC
[GitHub] [arrow] chaokunyang opened a new issue, #34927: [Compute][C++/Python] utf8_slice_codeunits doesn't support stop/step array type
chaokunyang opened a new issue, #34927:
URL: https://github.com/apache/arrow/issues/34927
### Describe the enhancement requested
Currently arrow compute `utf8_slice_codeunits` doesn't stop/step parameters with array type. When running following code, it'll raise `TypeError`
```python
import pyarrow as pa
import pyarrow.compute as pc
animals = pa.array(["A11A", "Horse", "Brittle stars", "Centipede"])
pc.utf8_slice_codeunits(animals, start=0, stop=pa.array([1, 2, 3, 4]))
```
Exception:
```
Traceback (most recent call last):
File "/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3460, in run_code
File "/var/folders/zz/mnr4zfjn45j2d_vl88bz8hm80000gp/T/ipykernel_13874/31766106.py", line 1, in <module>
pc.utf8_slice_codeunits(animals, start=0, stop=pa.array([1, 2, 3, 4]))
File "/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/compute.py", line 252, in wrapper
File "/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/compute.py", line 215, in _handle_options
def _wrap_function(name, func):
File "pyarrow/_compute.pyx", line 1168, in pyarrow._compute.SliceOptions.__init__
File "pyarrow/_compute.pyx", line 1147, in pyarrow._compute._SliceOptions._set_options
TypeError: an integer is required
```
It would be nice to add such support into arrow compute.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorisvandenbossche commented on issue #34927: [C++] utf8_slice_codeunits doesn't support stop/step array type
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on issue #34927:
URL: https://github.com/apache/arrow/issues/34927#issuecomment-1498947787
Yeah, the technical explanation for this is that this kernel is implemented as a unary kernel (so the only "argument" are the input strings), and the start/stop/step are passed through the SliceOptions class. And only actual arguments are automatically broadcasted (i.e. accepting scalar or array types as input).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] chaokunyang commented on issue #34927: [C++] utf8_slice_codeunits doesn't support stop/step array type
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #34927:
URL: https://github.com/apache/arrow/issues/34927#issuecomment-1499878848
> Yeah, the technical explanation for this is that this kernel is implemented as a unary kernel (so the only "argument" are the input strings), and the start/stop/step are passed through the SliceOptions class. And only actual arguments are automatically broadcasted (i.e. accepting scalar or array types as input).
It there any plan for implement this vectorized kernel? It's a common in SQL scene, I can help with this if it's planed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] chaokunyang commented on issue #34927: [C++] utf8_slice_codeunits doesn't support stop/step array type
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #34927:
URL: https://github.com/apache/arrow/issues/34927#issuecomment-1499882682
Implement a single kernel is easy, maybe we need a unified abstraction if other operands need to take array arguments?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org