Skip to content

[spark] Disable create table in default db - #9549

Merged
JingsongLi merged 3 commits into
apache:masterfrom
junmuz:feature/spark-disable-create-table-in-default-db
Sep 4, 2026
Merged

[spark] Disable create table in default db#9549
JingsongLi merged 3 commits into
apache:masterfrom
junmuz:feature/spark-disable-create-table-in-default-db

Conversation

@junmuz

@junmuz junmuz commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Purpose

  • Add a new SparkCatalog option disable-create-table-in-default-db (default false) that, when enabled, prevents the default database from being auto-created during catalog initialization and blocks CREATE TABLE statements targeting the default database. This is similar to FlinkCatalogOption
  • Works with both the standard default database and custom default databases configured via defaultDatabase

Tests

  • testDisableCreateTableInDefaultDb — verifies CREATE TABLE in default is rejected; creating databases and tables in non-default namespaces still works; inserted data is readable
  • testDisableCreateTableWithCustomDefaultDb — verifies the guard works when defaultDatabase is set to a custom value
  • testDefaultDatabaseNotCreatedWhenDisabled — verifies the default database is not auto-created during catalog initialization

@junmuz
junmuz force-pushed the feature/spark-disable-create-table-in-default-db branch from b95c8c9 to cba445c Compare September 3, 2026 10:21
@junmuz junmuz changed the title Feature/spark disable create table in default db [spark] Disable create table in default db Sep 3, 2026
@junmuz
junmuz force-pushed the feature/spark-disable-create-table-in-default-db branch from cba445c to 2104197 Compare September 3, 2026 16:54
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 0289f3d into apache:master Sep 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants