You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/06 10:43:39 UTC

[GitHub] [spark] AngersZhuuuu commented on a change in pull request #34815: [SPARK-37555][SQL] spark-sql should pass last unclosed comment to backend

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org