hustfeiwang commented on a change in pull request #23276: [SPARK-26321][SQL]
Improve the behavior of sql text splitting for the spark-sql command line
URL: https://github.com/apache/spark/pull/23276#discussion_r261491648
##########
File path:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
##########
@@ -331,6 +337,65 @@ private[hive] class SparkSQLCLIDriver extends CliDriver
with Logging {
console.printInfo(s"Spark master: $master, Application Id: $appId")
}
+ // method body imported from Hive and translated from Java to Scala
+ override def processLine(line: String, allowInterrupting: Boolean): Int = {
+ var oldSignal: SignalHandler = null
+ var interruptSignal: Signal = null
+
+ if (allowInterrupting) {
+ // Remember all threads that were running at the time we started line
processing.
+ // Hook up the custom Ctrl+C handler while processing this line
+ interruptSignal = new Signal("INT")
+ oldSignal = Signal.handle(interruptSignal, new SignalHandler() {
+ private val cliThread = Thread.currentThread()
Review comment:
what's the meaning of cliThread, I don't find any usage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]