Github user sun-rui commented on the pull request:
https://github.com/apache/spark/pull/9185#issuecomment-150162723
On the R side, there is a cache of created SQLContext/HiveContext, so R
won't call createSQLContext() second time. See
https://github.com/apache/spark/blob/master/R/pkg/R/sparkR.R#L218 and
https://github.com/apache/spark/blob/master/R/pkg/R/sparkR.R#L249. Also
[SPARK-11042](https://github.com/apache/spark/pull/9058) does prevent user from
creating multiple root SQLContexts (if multiple root SQLContexts is not
allowed). So there is no need to change createSQLContext().
However, I am not sure if we will support session in SparkR. If so, it
would make sense to do such change as getOrCreate() will return the active
SQLContext for current thread if it exists before returning the root
SQLContext/HiveContext?
@davies, I am curious why you implemented createSQLContext() in Scala as a
helper function for SparkR to create a SQLContext? It seems SparkR can directly
use newJObject("org.apache.spark.sql.SQLContext", sc) to create a SQLContext
just as the [creation of
HiveContext](https://github.com/apache/spark/blob/master/R/pkg/R/sparkR.R#L262).
---
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]