ianmcook commented on a change in pull request #10190:
URL: https://github.com/apache/arrow/pull/10190#discussion_r628343702
##########
File path: r/R/dplyr.R
##########
@@ -539,6 +541,44 @@ arrow_stringr_string_replace_function <- function(FUN,
max_replacements) {
}
}
+arrow_r_string_split_function <- function(FUN, reverse = FALSE, max_splits =
-1) {
+ function(x, split, fixed = FALSE, perl = FALSE, useBytes = FALSE) {
+
+ assert_that(is.string(split))
+
+ # if !fixed but no regex metachars in split pattern, allow to proceed as
split isn't regex
+ if (!fixed && contains_regex(split)) {
+ stop("Regular expression matching not supported in strsplit for Arrow",
call. = FALSE)
+ }
+ if (fixed && perl) {
Review comment:
Yes. We give a warning in this circumstance for consistency with base R.
Recall that the C++ function does not support regex splitting, so we don't
really support `fixed = FALSE` here, but _if_ `pattern` is not a regex, then we
can proceed and split on it without any warnings or errors regardless of the
value of `perl` which is also consistent with what base R would do.
--
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]