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/10/06 07:47:54 UTC

[GitHub] [arrow] maartenbreddels commented on a change in pull request #8271: ARROW-9991: [C++] split kernels for strings/binary

maartenbreddels commented on a change in pull request #8271:
URL: https://github.com/apache/arrow/pull/8271#discussion_r500071766



##########
File path: python/pyarrow/compute.py
##########
@@ -253,6 +255,68 @@ def match_substring(array, pattern):
                          MatchSubstringOptions(pattern))
 
 
+def split_pattern(array, pattern, max_splits=-1, reverse=False):
+    """
+    Replace string by a list of strings, separated by *pattern*.
+
+    Parameters
+    ----------
+    array : pyarrow.Array or pyarrow.ChunkedArray
+    pattern : str
+        pattern to split by
+    max_splits : int
+        If not -1, the maximum number of splits.
+    reverse : bool
+        Start splitting from the right, only meaningful when max_splits != -1
+
+    Returns
+    -------
+    result : pyarrow.Array or pyarrow.ChunkedArray
+    """
+    return call_function("split_pattern", [array],
+                         SplitPatternOptions(pattern, max_splits, reverse))

Review comment:
       I can take a look, I think it makes sense to add this indeed.




----------------------------------------------------------------
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