Skip to content

[core] Skip only the missing table when scanning global system tables - #11480

Open
taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/global-system-tables-concurrent-rename
Open

taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/global-system-tables-concurrent-rename

Conversation

@taoran92

@taoran92 taoran92 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Purpose

Closes #11479.

If a table is renamed or dropped after its name is listed but before it is loaded, looking it up by that name throws TableNotExistException. Previously, that exception ended the scan of the current database. Catch it at the individual lookup so the scan skips only the missing table and continues with the next name. This keeps unchanged tables visible in sys.tables, sys.all_table_options, and sys.partitions.

Tests

  • Added a regression to AllTablesTableTest that lists a stale name before an existing table and verifies that the existing table is returned.
  • Verified with two Spark SQL sessions sharing a filesystem catalog. While one session renamed t1, sys.tables still listed t2, and the option and partition for t3 remained visible in sys.all_table_options and sys.partitions. Reading t2 directly returned 42.

@taoran92
taoran92 marked this pull request as ready for review November 26, 2026 10:05
@taoran92 taoran92 changed the title [core] Keep unrelated tables visible in global system tables during a concurrent rename [core] Skip only the missing table when scanning global system tables Nov 26, 2026
@taoran92
taoran92 force-pushed the fix/global-system-tables-concurrent-rename branch from d396725 to fab3832 Compare November 26, 2026 10:13
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.

[Bug] Global system tables skip remaining tables when a listed table no longer exists

1 participant