Skip to content

[core] Harden catalog table type dispatch and external path parsing - #10251

Open
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-081-catalog-tblprops
Open

LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-081-catalog-tblprops

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

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 AbstractCatalog and JdbcCatalog. Without it, a parseable but unsupported type such as lance-table or iceberg-table (enum values that exist for the REST catalog) fell through the switch, so createTable returned success without creating anything and later access failed with table-not-exist. The default now rejects the type with UnsupportedOperationException.

Trim tokens and skip blanks in getSchemaExternalPaths. dropTable resolved data-file.external-paths by splitting the raw string on comma and passing each token to new 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 made new Path throw, so the table could no longer be dropped. Parsing now matches the write side.

This closes #10250.

Tests

FileSystemCatalogTest.testCreateTableWithUnsupportedTypeFailsLoudly: creating a table with type iceberg-table now throws UnsupportedOperationException and the table is not listed.

FileSystemCatalogTest.testDropTableToleratesBlankExternalPaths: a table whose data-file.external-paths has blank and space-padded segments can be dropped without error.

API and Format

No.

Documentation

No.

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
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] Filesystem/JDBC catalogs silently ignore CREATE TABLE for lance/iceberg types and crash DROP TABLE on spaced external paths

1 participant