You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/16 11:40:19 UTC

[GitHub] [arrow] kszucs commented on a change in pull request #7783: ARROW-9504: [C++/Python] Segmentation fault on ChunkedArray.take

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:
users@infra.apache.org