Repository navigation
fix: list tables without their metadata tables - #171
Open
NoahKusaba wants to merge 1 commit into
Open
NoahKusaba wants to merge 1 commit into
NoahKusaba wants to merge 1 commit into
Conversation
`table_names()` listed `t$snapshots`, `t$manifests` and `t$history` for every table. `SHOW TABLES` showed them as base tables, and `information_schema` looked each one up, loading every table from the catalog four times. Spark, Trino and Flink list only tables and resolve metadata tables by name, which still works here.
Contributor
Author
|
ez merge |
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.
Which issue does this PR close?
None filed; the change is small enough to explain here.
Rationale for this change
IcebergSchemaProvider::table_names()listedt$snapshots,t$manifestsandt$historyfor every tablet:SHOW TABLESshowed each one as aBASE TABLE, so a namespace with three tables listed twelve.information_schemacallstable()for every listed name, and each$lookup loadstfrom the catalog again.information_schema.columnsloaded every table four times.Other engines list only tables and resolve metadata tables when a query names them:
SparkCatalog.listTablesreturns the catalog's tables;db.t.snapshotsis recognised inloadTable.listTablesreturns the catalog's tables;t$snapshotsresolves throughgetSystemTable.FlinkCatalog.listTablesreturns the catalog's tables;t$snapshotsis split on$when it's looked up.What changes are included in this PR?
table_names()lists only the tables.t$snapshotsand the other metadata tables still resolve by name throughtable(), andtable_exist()still reports them, soCREATE EXTERNAL TABLEcan't take a metadata table's name.Are these changes tested?
Yes. The
SHOW TABLESexpectations inshow_tables.sltandtest_provider_list_table_nameslose the$names. Querying metadata tables by name is still covered bymetadata_tables.rsandinsert_into.slt, unchanged.Are there any user-facing changes?
Yes:
SHOW TABLESandinformation_schemano longer list metadata tables. They can still be queried by name, e.g.SELECT * FROM t$snapshots.