Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22227#discussion_r214244918
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -3410,13 +3410,14 @@ setMethod("collect_set",
     #' \dontrun{
     #' head(select(df, split_string(df$Sex, "a")))
     #' head(select(df, split_string(df$Class, "\\d")))
    +#' head(select(df, split_string(df$Class, "\\d", 2)))
     #' # This is equivalent to the following SQL expression
     #' head(selectExpr(df, "split(Class, '\\\\d')"))}
     #' @note split_string 2.3.0
     setMethod("split_string",
               signature(x = "Column", pattern = "character"),
    -          function(x, pattern) {
    -            jc <- callJStatic("org.apache.spark.sql.functions", "split", 
x@jc, pattern)
    +          function(x, pattern, limit = -1) {
    +            jc <- callJStatic("org.apache.spark.sql.functions", "split", 
x@jc, pattern, limit)
    --- End diff --
    
    you should have `as.integer(limit)` instead
    could we add a test in R?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to