You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] Converting from NumPy to large_string or large_binary returns not implemented #35289
pa.array(arr, type=pa.large_string())
File "pyarrow/array.pxi", line 316, in pyarrow.lib.array
File "pyarrow/array.pxi", line 83, in pyarrow.lib._ndarray_to_array
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: NumPyConverter doesn't implement <large_string> conversion.
auto data = reinterpret_cast<constuint8_t*>(PyArray_DATA(arr_));
But no equivalent Visit(const LargeStringType& type). The implementation for StringType is based on ChunkedStringBuilder, which is a chunked version of StringBuilder. We already have LargeStringBuilder, so it should certainly be possible to add a ChunkedLargeStringBuilder as well, so we can template the NumPyConverter to work with both builders.
Activity
jorisvandenbossche commentedon Apr 26, 2023
Yes, there is indeed no specific reason for this to not work (apart from someone implementing it).
Looking at the code, this is default fallback because the
NumPyConverteronly is implemented for the non-large StringType. We have this:arrow/python/pyarrow/src/arrow/python/numpy_to_arrow.cc
Lines 661 to 666 in c38c778
But no equivalent
Visit(const LargeStringType& type). The implementation for StringType is based onChunkedStringBuilder, which is a chunked version ofStringBuilder. We already haveLargeStringBuilder, so it should certainly be possible to add aChunkedLargeStringBuilderas well, so we can template theNumPyConverterto work with both builders.[SPARK-39979][SQL][FOLLOW-UP] Make `spark.sql.execution.arrow.useLarg…
[SPARK-39979][SQL][FOLLOW-UP] Make `spark.sql.execution.arrow.useLarg…
apacheGH-35289: [Python] Support large variable width types in numpy …