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

    https://github.com/apache/spark/pull/7191#discussion_r35708346
  
    --- Diff: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
 ---
    @@ -239,25 +251,33 @@ private[hive] class SparkSQLCLIDriver extends 
CliDriver with Logging {
     
       private val console = new SessionState.LogHelper(LOG)
     
    +  private val isRemoteMode = {
    +    SparkSQLCLIDriver.isRemoteMode(sessionState)
    +  }
    +
       private val conf: Configuration =
         if (sessionState != null) sessionState.getConf else new Configuration()
     
       // Force initializing SparkSQLEnv. This is put here but not object 
SparkSQLCliDriver
       // because the Hive unit tests do not go through the main() code path.
    -  if (!sessionState.isRemoteMode) {
    +  if (!isRemoteMode) {
         SparkSQLEnv.init()
    +  } else {
    +    // Hive 1.2 + not supported in CLI
    +    throw new RuntimeException("Remote operations not supported")
       }
     
       override def processCmd(cmd: String): Int = {
         val cmd_trimmed: String = cmd.trim()
    +    val cmd_lower = cmd_trimmed.toLowerCase(Locale.ENGLISH)
         val tokens: Array[String] = cmd_trimmed.split("\\s+")
         val cmd_1: String = cmd_trimmed.substring(tokens(0).length()).trim()
    -    if (cmd_trimmed.toLowerCase.equals("quit") ||
    -      cmd_trimmed.toLowerCase.equals("exit") ||
    -      tokens(0).equalsIgnoreCase("source") ||
    +    if (cmd_lower.equals("quit") ||
    +      cmd_lower.equals("exit") ||
    +      tokens(0).toLowerCase(Locale.ENGLISH).equals("source") ||
           cmd_trimmed.startsWith("!") ||
           tokens(0).toLowerCase.equals("list") ||
    -      sessionState.isRemoteMode) {
    +      isRemoteMode) {
    --- End diff --
    
    is it still possible for us to be in remote mode here? or will we have 
already thrown an error?


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