AngersZhuuuu commented on a change in pull request #34815:
URL: https://github.com/apache/spark/pull/34815#discussion_r762890523



##########
File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
##########
@@ -613,7 +613,7 @@ private[hive] class SparkSQLCLIDriver extends CliDriver 
with Logging {
 
       isStatement = statementInProgress(index)
     }
-    if (isStatement) {
+    if (beginIndex < line.length()) {

Review comment:
       Avoid pass an blank string to `processLine`, although in `processLine` 
it will handle this 
   ```
         // we can not use "split" function directly as ";" may be quoted
         val commands = splitSemiColon(line).asScala
         var command: String = ""
         for (oneCmd <- commands) {
           if (StringUtils.endsWith(oneCmd, "\\")) {
             command += StringUtils.chop(oneCmd) + ";"
           } else {
             command += oneCmd
             if (!StringUtils.isBlank(command)) {
               val ret = processCmd(command)
               command = ""
               lastRet = ret
               val ignoreErrors = HiveConf.getBoolVar(conf, 
HiveConf.ConfVars.CLIIGNOREERRORS)
               if (ret != 0 && !ignoreErrors) {
                 CommandProcessorFactory.clean(conf.asInstanceOf[HiveConf])
                 return ret
               }
             }
           }
         }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to