-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-35242][SQL] Support change catalog default database for spark #32364
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ package org.apache.spark.sql.internal | |
| import java.util.Locale | ||
| import java.util.concurrent.TimeUnit | ||
|
|
||
| import org.apache.spark.sql.connector.catalog.CatalogManager.SESSION_CATALOG_NAME | ||
| import org.apache.spark.util.Utils | ||
|
|
||
|
|
||
|
|
@@ -37,6 +38,13 @@ object StaticSQLConf { | |
| .stringConf | ||
| .createWithDefault(Utils.resolveURI("spark-warehouse").toString) | ||
|
|
||
| val CATALOG_DEFAULT_DATABASE = | ||
| buildStaticConf(s"spark.sql.catalog.$SESSION_CATALOG_NAME.defaultDatabase") | ||
| .doc("The default database for session catalog.") | ||
| .version("3.2.0") | ||
| .stringConf | ||
| .createWithDefault("default") | ||
|
||
|
|
||
| val CATALOG_IMPLEMENTATION = buildStaticConf("spark.sql.catalogImplementation") | ||
| .internal() | ||
| .version("2.0.0") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it look like it's a runtime config. Let's write
getConf(StaticSQLConf.CATALOG_DEFAULT_DATABASE)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW it's a bit tricky to access the active SQLConf in scala object. Can we read the conf in
BaseSessionStateBuilderand pass it toSessionCatalog?