Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/3663#discussion_r21938246
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala ---
@@ -218,34 +219,26 @@ class HiveContext(sc: SparkContext) extends
SQLContext(sc) {
}
}
- /**
- * SQLConf and HiveConf contracts:
- *
- * 1. reuse existing started SessionState if any
- * 2. when the Hive session is first initialized, params in HiveConf
will get picked up by the
- * SQLConf. Additionally, any properties set by set() or a SET
command inside sql() will be
- * set in the SQLConf *as well as* in the HiveConf.
- */
- @transient protected[hive] lazy val (hiveconf, sessionState) =
- Option(SessionState.get())
- .orElse {
- val newState = new SessionState(new
HiveConf(classOf[SessionState]))
- // Only starts newly created `SessionState` instance. Any
existing `SessionState` instance
- // returned by `SessionState.get()` must be the most recently
started one.
- SessionState.start(newState)
- Some(newState)
- }
- .map { state =>
+ @transient lazy val currentSessionState = new
ThreadLocal[SessionState]() {
--- End diff --
I'm not sure we want to expose this as part of the public API, perhaps keep
it as `protected[sql]`.
---
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]