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

    https://github.com/apache/spark/pull/17674#discussion_r112106399
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -3652,3 +3652,56 @@ setMethod("posexplode",
                 jc <- callJStatic("org.apache.spark.sql.functions", 
"posexplode", x@jc)
                 column(jc)
               })
    +
    +#' create_array
    +#'
    +#' Creates a new array column. The input columns must all have the same 
data type.
    +#'
    +#' @param x Column to compute on
    +#' @param ... other columns
    +#'
    +#' @family collection_funcs
    +#' @rdname create_array
    +#' @name create_array
    +#' @aliases create_array,Column-method
    +#' @export
    +#' @examples \dontrun{create_array(df$x, df$y, df$z)}
    +#' @note create_array since 2.3.0
    +setMethod("create_array",
    +          signature(x = "Column"),
    +          function(x, ...) {
    +            jcols <- lapply(list(x, ...), function (x) {
    +              stopifnot(class(x) == "Column")
    +              x@jc
    +            })
    +            jc <- callJStatic("org.apache.spark.sql.functions", "array", 
jcols)
    +            column(jc)
    +          })
    +
    +#' create_map
    +#'
    +#' Creates a new map column. The input columns must be grouped as 
key-value pairs,
    +#' e.g. (key1, value1, key2, value2, ...).
    +#' The key columns must all have the same data type, and can't be null.
    --- End diff --
    
    `null` in JVM is mapped to NA in R - we haven't documented that 
consistently, but would be good to start thinking about the better way to do 
that


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to