Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-9315 SparkR DataFrame improvements to be more R-friendly
  3. SPARK-11199

Improve R context management story and add getOrCreate

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5.1
    • 2.0.0
    • SparkR
    • None

    Description

      Similar to SPARK-11114

      Also from discussion in SPARK-10903:
      "
      Hossein Falaki added a comment - 08/Oct/15 13:06
      +1 We have seen a lot of questions from new SparkR users about the life cycle of the context.
      My question is: are we going to remove or deprecate sparkRSQL.init()? I suggest we should, because right now calling that method creates a new Java SQLContext object, and having two of them prevents users form viewing temp tables.

      Felix Cheung added a comment - 08/Oct/15 17:13
      +1 perhaps sparkR.init() should create sqlContext and/or hiveCtx together.
      But Hossein Falaki, as of now calling sparkRSQL.init() should return the same one as you can see https://github.com/apache/spark/blob/master/R/pkg/R/sparkR.R#L224

      Hossein Falaki added a comment - 08/Oct/15 17:16
      I meant the SQL Context: https://github.com/apache/spark/blob/master/R/pkg/R/sparkR.R#L236
      This call should have been "getOrCreate."
      "

      Attachments

        Activity

          People

            falaki Hossein Falaki
            felixcheung Felix Cheung
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: