Skip to content

Commit 7afb0ec

Browse files
committed
Fix the configurations about HiveThriftServer
1 parent 7e728e3 commit 7afb0ec

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,16 @@ private[spark] object SQLConf {
271271
doc = "<TODO>")
272272

273273
// This is only used for the thriftserver
274-
val THRIFTSERVER_POOL = stringConf("spark.sql.thriftserver.scheduler.pool", isPublic = false)
274+
val THRIFTSERVER_POOL = stringConf("spark.sql.thriftserver.scheduler.pool",
275+
doc = "Set a Fair Scheduler pool for a JDBC client session")
275276

276-
val THRIFTSERVER_UI_STATEMENT_LIMIT =
277-
intConf("spark.sql.thriftserver.ui.retainedStatements", isPublic = false)
277+
val THRIFTSERVER_UI_STATEMENT_LIMIT = intConf("spark.sql.thriftserver.ui.retainedStatements",
278+
defaultValue = Some(200),
279+
doc = "<TODO>")
278280

279-
val THRIFTSERVER_UI_SESSION_LIMIT =
280-
intConf("spark.sql.thriftserver.ui.retainedSessions", isPublic = false)
281+
val THRIFTSERVER_UI_SESSION_LIMIT = intConf("spark.sql.thriftserver.ui.retainedSessions",
282+
defaultValue = Some(200),
283+
doc = "<TODO>")
281284

282285
// This is used to set the default data source
283286
val DEFAULT_DATA_SOURCE_NAME = stringConf("spark.sql.sources.default",
@@ -529,7 +532,8 @@ private[sql] class SQLConf extends Serializable with CatalystConf {
529532

530533
/**
531534
* Return the value of Spark SQL configuration property for the given key. If the key is not set
532-
* yet, return `defaultValue`.
535+
* yet, return `defaultValue`. This is useful when `defaultValue` in SQLConfEntry is not the
536+
* desired one.
533537
*/
534538
def getConf[T](entry: SQLConfEntry[T], defaultValue: T): T = {
535539
require(sqlConfEntries.get(entry.key) == entry, s"$entry is not registered")

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ object HiveThriftServer2 extends Logging {
153153
val sessionList = new mutable.LinkedHashMap[String, SessionInfo]
154154
val executionList = new mutable.LinkedHashMap[String, ExecutionInfo]
155155
val retainedStatements =
156-
conf.getConf(SQLConf.THRIFTSERVER_UI_STATEMENT_LIMIT, 200)
156+
conf.getConf(SQLConf.THRIFTSERVER_UI_STATEMENT_LIMIT)
157157
val retainedSessions =
158-
conf.getConf(SQLConf.THRIFTSERVER_UI_SESSION_LIMIT, 200)
158+
conf.getConf(SQLConf.THRIFTSERVER_UI_SESSION_LIMIT)
159159
var totalRunning = 0
160160

161161
override def onJobStart(jobStart: SparkListenerJobStart): Unit = {

0 commit comments

Comments
 (0)