Skip to content

[C++] Take kernel can't handle ChunkedArrays that don't fit in an Array #25822

Description

@asfimport

Take() currently concatenates ChunkedArrays first. However, this breaks down when calling Take() from a ChunkedArray or Table where concatenating the arrays would result in an array that's too large. While inconvenient to implement, it would be useful if this case were handled.

This could be done as a higher-level wrapper around Take(), perhaps.

Example in Python:

>>>importpyarrowaspa>>>pa.__version__'1.0.0'>>>rb1=pa.RecordBatch.from_arrays([["a"*2**30]], names=["a"])
>>>rb2=pa.RecordBatch.from_arrays([["b"*2**30]], names=["a"])
>>>table=pa.Table.from_batches([rb1, rb2], schema=rb1.schema)
>>>table.take([1, 0])
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"pyarrow/table.pxi", line1145, inpyarrow.lib.Table.takeFile"/home/lidavidm/Code/twosigma/arrow/venv/lib/python3.8/site-packages/pyarrow/compute.py", line268, intakereturncall_function('take', [data, indices], options)
File"pyarrow/_compute.pyx", line298, inpyarrow._compute.call_functionFile"pyarrow/_compute.pyx", line192, inpyarrow._compute.Function.callFile"pyarrow/error.pxi", line122, inpyarrow.lib.pyarrow_internal_check_statusFile"pyarrow/error.pxi", line84, inpyarrow.lib.check_statuspyarrow.lib.ArrowInvalid: offsetoverflowwhileconcatenatingarrays

In this example, it would be useful if Take() or a higher-level wrapper could generate multiple record batches as output.

Reporter: Will Jones / @wjones127
Assignee: Will Jones / @wjones127

Related issues:

PRs and other links:

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions