kszucs commented on a change in pull request #7783:
URL: https://github.com/apache/arrow/pull/7783#discussion_r455723033
##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -284,6 +284,66 @@ def test_take_indices_types():
arr.take(indices)
+def test_take_on_chunked_array():
+ # ARROW-9504
+ arr = pa.chunked_array([
+ [
+ "m",
+ "J",
+ "q",
+ "k",
+ "t"
+ ],
+ [
+ "m",
+ "J",
+ "q",
+ "k",
+ "t"
+ ]
+ ])
+
+ indices = np.array([0, 5, 1, 6, 2, 7, 3, 8, 4, 9])
+ result = arr.take(indices)
+ expected = pa.chunked_array([
+ "m",
+ "m",
+ "J",
+ "J",
+ "q",
+ "q",
+ "k",
+ "k",
+ "t"
+ "t"
+ ])
Review comment:
To use a chunked array as indices because the number of output chunks
depends on it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]