[ 
https://issues.apache.org/jira/browse/SPARK-10903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14940694#comment-14940694
 ] 

Felix Cheung commented on SPARK-10903:
--------------------------------------

toDF is doing checks in preference order
btw, what functions we want to automatically find the sqlContext?
{code}
setMethod("toDF", signature(x = "RDD"),
          function(x, ...) {
            sqlContext <- if (exists(".sparkRHivesc", envir = .sparkREnv)) {
              get(".sparkRHivesc", envir = .sparkREnv)
            } else if (exists(".sparkRSQLsc", envir = .sparkREnv)) {
              get(".sparkRSQLsc", envir = .sparkREnv)
            } else {
              stop("no SQL context available")
            }
            createDataFrame(sqlContext, x, ...)
          })
{code}

> Make sqlContext global 
> -----------------------
>
>                 Key: SPARK-10903
>                 URL: https://issues.apache.org/jira/browse/SPARK-10903
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SparkR
>            Reporter: Narine Kokhlikyan
>            Priority: Minor
>
> Make sqlContext global so that we don't have to always specify it.
> e.g. createDataFrame(iris) instead of createDataFrame(sqlContext, iris)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to