diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala index 6dd438ffdc9..649bdf8b981 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala @@ -327,6 +327,10 @@ object SparkSQLEngine extends Logging { SparkTBinaryFrontendService.renewDelegationToken(session.sparkContext, credentials) } + kyuubiConf.get(ENGINE_SPARK_LOG_LEVEL).foreach { level => + session.sparkContext.setLogLevel(level) + } + KyuubiSparkUtil.initializeSparkSession( session, kyuubiConf.get(ENGINE_SPARK_INITIALIZE_SQL) ++ kyuubiConf.get( diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala index 2aa5030ca60..769794eddcd 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala @@ -3471,4 +3471,17 @@ object KyuubiConf { .version("1.8.1") .booleanConf .createWithDefault(false) + + object LOG_LEVEL extends Enumeration { + type LOG_LEVEL = Value + val ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN = Value + } + + val ENGINE_SPARK_LOG_LEVEL: OptionalConfigEntry[String] = + buildConf("kyuubi.engine.log.level") + .doc("The initialize sql for Spark engine.") + .version("1.9.1") + .stringConf + .checkValues(LOG_LEVEL) + .createOptional }