Revert "[SPARK-32772][SQL][FOLLOWUP] Remove legacy silent support mode for spark-sql CLI"

This reverts commit f1f7ae420e.
This commit is contained in:
HyukjinKwon 2020-09-10 14:22:38 +09:00
parent e0538bd38c
commit 4a096131ee

View file

@ -35,6 +35,7 @@ import org.apache.hadoop.hive.ql.Driver
import org.apache.hadoop.hive.ql.processors._
import org.apache.hadoop.hive.ql.session.SessionState
import org.apache.hadoop.security.{Credentials, UserGroupInformation}
import org.apache.log4j.Level
import org.apache.thrift.transport.TSocket
import sun.misc.{Signal, SignalHandler}
@ -319,6 +320,9 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging {
// because the Hive unit tests do not go through the main() code path.
if (!isRemoteMode) {
SparkSQLEnv.init()
if (sessionState.getIsSilent) {
SparkSQLEnv.sparkContext.setLogLevel(Level.WARN.toString)
}
} else {
// Hive 1.2 + not supported in CLI
throw new RuntimeException("Remote operations not supported")