Describe the bug, including details regarding any error messages, version, and platform.
Run the following Python code:
import pyarrow
t = pyarrow.repeat('RANDOM_STR', 10**8)
f = pyarrow.repeat('RANDOM_STR_LARGE', 10**8)
m = pyarrow.repeat(False, 10**8)
pyarrow.compute.if_else(m, t, f)
This segfaults almost immediately on my computer.
The error message is Fatal Python error: Segmentation fault.
The cause of the issue that the arguments have string type but the result does not fit in the string type. If one were to cast the argument from string to large_string prior to calling if_else then it works.
This should either raise a proper exception in Python or silently do the cast for the user. It should not segfault.
Component(s)
Python