Github user felixcheung commented on a diff in the pull request: https://github.com/apache/spark/pull/13635#discussion_r67294797 --- Diff: R/pkg/R/sparkR.R --- @@ -270,27 +291,97 @@ sparkRSQL.init <- function(jsc = NULL) { #'} sparkRHive.init <- function(jsc = NULL) { - if (exists(".sparkRHivesc", envir = .sparkREnv)) { - return(get(".sparkRHivesc", envir = .sparkREnv)) + .Deprecated("sparkR.session.getOrCreate") + + if (exists(".sparkRsession", envir = .sparkREnv)) { + return(get(".sparkRsession", envir = .sparkREnv)) } - # If jsc is NULL, create a Spark Context - sc <- if (is.null(jsc)) { - sparkR.init() - } else { - jsc + # Default to without Hive support for backward compatibility. + sparkR.session.getOrCreate(enableHiveSupport = TRUE) +} + +#' Get the existing SparkSession or initialize a new SparkSession. +#' +#' Additional Spark properties can be set (...), and these named parameters take priority over +#' over values in master, appName, named lists of sparkConfig. +#' +#' @param master The Spark master URL +#' @param appName Application name to register with cluster manager +#' @param sparkHome Spark Home directory +#' @param sparkConfig Named list of Spark configuration to set on worker nodes +#' @param sparkExecutorConfig Named list of Spark configuration to be used when launching executors --- End diff -- These goes to sparkConf.setExecutorEnv, ``` " Set an environment variable to be used when launching executors for this application. * These variables are stored as properties of the form spark.executorEnv.VAR_NAME " ``` I'd prefer not having this since they are not called out separately in Python or Scala? I keep it mainly so that someone can easily with minimal change going from `sparkR.init(sparkExecutorEnv = list())` to `sparkR.session(sparkExecutorConfig = list())`
--- 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