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

    https://github.com/apache/spark/pull/17729#discussion_r112853256
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -3745,3 +3745,55 @@ setMethod("collect_set",
                 jc <- callJStatic("org.apache.spark.sql.functions", 
"collect_set", x@jc)
                 column(jc)
               })
    +
    +#' split_string
    +#'
    +#' Splits string on regular expression.
    +#'
    +#' @param x Column to compute on
    +#' @param pattern Java regular expression
    +#'
    +#' @rdname split_string
    +#' @family string_funcs
    +#' @aliases split_string,Column-method
    +#' @export
    +#' @examples \dontrun{
    +#' df <- read.text("README.md")
    +#'
    +#' head(select(split_string(df$value, "\\s+")))
    +#' }
    +#' @note split_string 2.3.0
    +#' @note equivalent to \code{split} SQL function
    +setMethod("split_string",
    +          signature(x = "Column", pattern = "character"),
    +          function(x, pattern) {
    +            jc <- callJStatic("org.apache.spark.sql.functions", "split", 
x@jc, pattern)
    +            column(jc)
    +          })
    +
    +#' repeat_string
    +#'
    +#' Repeats string n times.
    +#'
    +#' @param x Column to compute on
    +#' @param n Number of repetitions
    +#'
    +#' @rdname repeat_string
    +#' @family string_funcs
    +#' @aliases repeat_string,Column-method
    +#' @export
    +#' @examples \dontrun{
    +#' df <- createDataFame(data.frame(
    +#'   text = c("foo", "bar")
    +#' ))
    --- End diff --
    
    I thought about this but it is hard to find a good source at hand. We could 
use `data/streaming/AFINN-111.txt` which has nice and short lines, or 
`README.md` and just take `head(., 1)` (the rest is empty or  longish.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to