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

    https://github.com/apache/spark/pull/16247#discussion_r92250724
  
    --- Diff: R/pkg/R/sparkR.R ---
    @@ -362,6 +362,10 @@ sparkR.session <- function(
       enableHiveSupport = TRUE,
       ...) {
     
    +  if (length(sparkConfig[["spark.sql.warehouse.dir"]]) == 0) {
    +    sparkConfig[["spark.sql.warehouse.dir"]] <- tempdir()
    --- End diff --
    
    There is the pb of circular dependency for getting the hive warehouse dir.
    
    I think currently in sparkR, to create SparkSession, we need all those 
parameter and once spark session is there we can call 
    ```R
    sparkContext <- SparkR:::callJMethod(sc, "sparkContext") 
    haddopConf <- SparkR:::callJMethod(sparkContext, "hadoopConfiguration")
    hivewarehouseDir <- SparkR:::callJMethod(hadoopConf, "get", 
"hive.metastore.warehouse.dir"") 
    ```
    
    but the above logic requires that we have sparksession available but there 
is no spark session yet at this line of code. So there must a way to get the 
hive.conf directory from env.
    we have to make decision that is it ok to get the env from system or not? 
something like the following
    
    ```R
    require(XML)
    data <- xmlParse(file.path(Sys.env("HADOOP_HOME", "conf", "hive-site.xml")
    xml_data <- xmlToList(data)
    ```
    
    it will make sparkR dependent on xml parser . just some thoughts :)


---
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