pan3793 commented on code in PR #54946:
URL: https://github.com/apache/spark/pull/54946#discussion_r3469283599
##########
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:
##########
@@ -255,30 +258,44 @@ private[hive] object SparkSQLCLIDriver extends Logging {
def continuedPromptWithDBSpaces: String = continuedPrompt +
ReflectionUtils.invokeStatic(
classOf[CliDriver], "spacesForString", classOf[String] -> currentDB)
+ val sqlParser = SparkSQLEnv.sparkSession.sessionState.sqlParser
var currentPrompt = promptWithCurrentDB
var line = reader.readLine(currentPrompt + "> ")
while (line != null) {
// SPARK-55198: call line.trim to also skip comment line with leading
whitespaces,
// this keeps the behavior align with HIVE-8396
if (!line.trim.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
+ val candidate = if (buffer.isEmpty) line else buffer + "\n" + line
Review Comment:
restored original behavior, and added a new test in `CliSuite` -
`SPARK-56147: \; at end of line is a Hive-compat line continuation marker`.
--
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]