[core] Harden catalog table type dispatch and external path parsing - #10251
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
The create-table switch over TableType had no default branch, so a DDL with an unsupported but parseable type like iceberg-table or lance-table fell through silently on filesystem and JDBC catalogs: the statement reported success without creating anything and every later query failed with table-not-exist. Reject unsupported types explicitly in both AbstractCatalog and JdbcCatalog's duplicated switch. getSchemaExternalPaths fed the raw comma-split tokens of the external path options straight into new Path while the create-time validation trims and tolerates blanks, so a value with empty segments or spaces made every DROP TABLE crash. Trim and skip blank segments like the write side does. Assisted-by: GLM-5.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Two fixes in the catalog create/drop path, both reachable via normal DDL on filesystem and JDBC catalogs.
Add a default branch to the create-table type dispatch in
AbstractCatalogandJdbcCatalog. Without it, a parseable but unsupported type such aslance-tableoriceberg-table(enum values that exist for the REST catalog) fell through the switch, socreateTablereturned success without creating anything and later access failed with table-not-exist. The default now rejects the type withUnsupportedOperationException.Trim tokens and skip blanks in
getSchemaExternalPaths.dropTableresolveddata-file.external-pathsby splitting the raw string on comma and passing each token tonew Path, while the write side trims. A documented multi-value setting with a space after the comma produced a token with a leading space and madenew Paththrow, so the table could no longer be dropped. Parsing now matches the write side.This closes #10250.
Tests
FileSystemCatalogTest.testCreateTableWithUnsupportedTypeFailsLoudly: creating a table with typeiceberg-tablenow throwsUnsupportedOperationExceptionand the table is not listed.FileSystemCatalogTest.testDropTableToleratesBlankExternalPaths: a table whosedata-file.external-pathshas blank and space-padded segments can be dropped without error.API and Format
No.
Documentation
No.