You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2017/12/27 01:23:04 UTC

[GitHub] spark pull request #20075: [SPARK-21208][R] Adds setLocalProperty and getLoc...

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

    https://github.com/apache/spark/pull/20075#discussion_r158751340
  
    --- Diff: R/pkg/R/sparkR.R ---
    @@ -560,10 +560,55 @@ cancelJobGroup <- function(sc, groupId) {
     #'}
     #' @note setJobDescription since 2.3.0
     setJobDescription <- function(value) {
    +  if (!is.null(value)) {
    +    value <- as.character(value)
    +  }
       sc <- getSparkContext()
       invisible(callJMethod(sc, "setJobDescription", value))
     }
     
    +#' Set a local property that affects jobs submitted from this thread, such as the
    +#' Spark fair scheduler pool.
    +#'
    +#' @param key The key for a local property.
    +#' @param value The value for a local property.
    +#' @rdname setLocalProperty
    +#' @name setLocalProperty
    +#' @examples
    +#'\dontrun{
    +#' setLocalProperty("spark.scheduler.pool", "poolA")
    +#'}
    +#' @note setLocalProperty since 2.3.0
    +setLocalProperty <- function(key, value) {
    +  if (is.null(key) || is.na(key)) {
    +    stop("key should not be NULL or NA.")
    +  }
    +  if (!is.null(value)) {
    --- End diff --
    
    Just to be clear, `is.na` case seems fine with passing it with `as.character`. I added the test.



---

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