diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2015-03-17 12:29:15 +0800 |
---|---|---|
committer | Cheng Lian <lian@databricks.com> | 2015-03-17 12:29:15 +0800 |
commit | 9667b9f9c3239f814a0b1120355d9e7bd7a89158 (patch) | |
tree | 13c22d1b43c2ded382a24b0f18be6eeee4c1c400 /sql/hive-thriftserver/src/main | |
parent | e3f315ac358dfe4f5b9705c3eac76e8b1e24f82a (diff) | |
download | spark-9667b9f9c3239f814a0b1120355d9e7bd7a89158.tar.gz spark-9667b9f9c3239f814a0b1120355d9e7bd7a89158.tar.bz2 spark-9667b9f9c3239f814a0b1120355d9e7bd7a89158.zip |
[SPARK-5712] [SQL] fix comment with semicolon at end
---- comment;
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #4500 from adrian-wang/semicolon and squashes the following commits:
70b8abb [Daoyuan Wang] use mkstring instead of reduce
2d49738 [Daoyuan Wang] remove outdated golden file
317346e [Daoyuan Wang] only skip comment with semicolon at end of line, to avoid golden file outdated
d3ae01e [Daoyuan Wang] fix error
a11602d [Daoyuan Wang] fix comment with semicolon at end
Diffstat (limited to 'sql/hive-thriftserver/src/main')
-rw-r--r-- | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala index 401e97b162..895688ab2e 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala @@ -202,20 +202,21 @@ private[hive] object SparkSQLCLIDriver { var line = reader.readLine(currentPrompt + "> ") while (line != null) { - if (prefix.nonEmpty) { - prefix += '\n' - } + if (!line.startsWith("--")) { + if (prefix.nonEmpty) { + prefix += '\n' + } - if (line.trim().endsWith(";") && !line.trim().endsWith("\\;")) { - line = prefix + line - ret = cli.processLine(line, true) - prefix = "" - currentPrompt = promptWithCurrentDB - } else { - prefix = prefix + line - currentPrompt = continuedPromptWithDBSpaces + if (line.trim().endsWith(";") && !line.trim().endsWith("\\;")) { + line = prefix + line + ret = cli.processLine(line, true) + prefix = "" + currentPrompt = promptWithCurrentDB + } else { + prefix = prefix + line + currentPrompt = continuedPromptWithDBSpaces + } } - line = reader.readLine(currentPrompt + "> ") } |