Skip to content

[python] Reject operations on the system database - #10841

Merged
JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/python-reject-system-database-ops
Oct 28, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/python-reject-system-database-ops

Conversation

@plusplusjiajia

Copy link
Copy Markdown
Member

Purpose

As in Java AbstractCatalog and RESTCatalog (CatalogUtils.checkNotSystemDatabase / checkNotSystemTable), create_database, drop_database and alter_database now reject the system database sys with Java's message, and create_table, drop_table, rename_table and alter_table reject tables in it (ValueError in Python, IllegalArgumentException in Java).

PyPaimon's filesystem, JDBC and REST catalogs accepted them, so for example create_database('sys') and create_table('sys.t') succeeded, although Java resolves sys.* to global system tables and never sees such tables. The REST catalog sent these requests to the server.

This follows #10822, which added the branch and system table checks.

Tests

  • assert_table_guards, shared by CatalogTableGuardTest (filesystem and JDBC) and RESTCatalogTest#test_table_operations_reject_branch_and_system_tables: creating, dropping and altering sys, and creating, dropping, renaming to and altering sys.t raise, and sys is not listed.
  • The tests fail on master. The catalog, REST and JDBC tests pass locally: 609 tests. flake8 is clean.

@plusplusjiajia
plusplusjiajia marked this pull request as ready for review October 27, 2026 14:59
As in Java AbstractCatalog and RESTCatalog, create_database,
drop_database and alter_database reject the system database sys, and
create_table, drop_table, rename_table and alter_table reject tables in
it, as Java's checkNotSystemTable does. PyPaimon's filesystem, JDBC and
REST catalogs accepted them, so for example create_database('sys') and
create_table('sys.t') succeeded, although Java resolves sys.* to global
system tables and never sees such tables.
@plusplusjiajia
plusplusjiajia force-pushed the fix/python-reject-system-database-ops branch from 1543ebb to 1bcd70e Compare October 28, 2026 07:09
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 2e61ff8 into apache:master Oct 28, 2026
21 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