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

    https://github.com/apache/spark/pull/9589#discussion_r48777449
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/ClientWrapper.scala ---
    @@ -151,29 +152,34 @@ private[hive] class ClientWrapper(
         // Switch to the initClassLoader.
         Thread.currentThread().setContextClassLoader(initClassLoader)
         val ret = try {
    -      val initialConf = new HiveConf(classOf[SessionState])
    -      // HiveConf is a Hadoop Configuration, which has a field of 
classLoader and
    -      // the initial value will be the current thread's context class 
loader
    -      // (i.e. initClassLoader at here).
    -      // We call initialConf.setClassLoader(initClassLoader) at here to 
make
    -      // this action explicit.
    -      initialConf.setClassLoader(initClassLoader)
    -      config.foreach { case (k, v) =>
    -        if (k.toLowerCase.contains("password")) {
    -          logDebug(s"Hive Config: $k=xxx")
    -        } else {
    -          logDebug(s"Hive Config: $k=$v")
    +      val registeredState = SessionState.get
    +      if (registeredState != null && 
registeredState.isInstanceOf[CliSessionState]) {
    --- End diff --
    
    I'm not arguing against the change to avoid replacing the SessionState if 
it already exists.  I'm asking why it has to check to see if it is a 
`CliSessionState` or not in order for this logic to work.  Ideally we would not 
couple these components this closely.  If we have to do so, then you need to 
explain why.


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