Skip to content

[SPARK-30617][SQL] Stop check values of spark.sql.catalogImplementation to improve expansibility #27349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ object StaticSQLConf {
.createWithDefault(Utils.resolveURI("spark-warehouse").toString)

val CATALOG_IMPLEMENTATION = buildStaticConf("spark.sql.catalogImplementation")
.internal()
.doc("Spark built-in implementation is in-memory and hive, " +
"when set to yourImpl(can be any words), " +
"you need also provide following configurations to make everything going: " +
"`spark.sql.catalogImplementation.yourImpl.builder` " +
"`spark.sql.catalogImplementation.yourImpl.externalCatalog`.")
.stringConf
.checkValues(Set("hive", "in-memory"))
.createWithDefault("in-memory")

val GLOBAL_TEMP_DATABASE = buildStaticConf("spark.sql.globalTempDatabase")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,12 @@ object SparkSession extends Logging {
conf.get(CATALOG_IMPLEMENTATION) match {
case "hive" => HIVE_SESSION_STATE_BUILDER_CLASS_NAME
case "in-memory" => classOf[SessionStateBuilder].getCanonicalName
case other => conf.getOption(s"spark.sql.catalogImplementation.$other.builder")
.getOrElse {
throw new IllegalArgumentException(
s"You need to configure spark.sql.catalogImplementation.$other.builder when " +
s"`$other` configured by spark.sql.catalogImplementation is not in-memory nor hive.")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ object SharedState extends Logging {
conf.get(CATALOG_IMPLEMENTATION) match {
case "hive" => HIVE_EXTERNAL_CATALOG_CLASS_NAME
case "in-memory" => classOf[InMemoryCatalog].getCanonicalName
case other => conf.getOption(s"spark.sql.catalogImplementation.$other.externalCatalog")
.getOrElse {
throw new IllegalArgumentException(
s"You need to configure spark.sql.catalogImplementation.$other.externalCatalog when " +
s"`$other` configured by spark.sql.catalogImplementation is not in-memory nor hive.")
}
}
}

Expand Down