Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions crates/datafusion/src/catalog/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,13 @@ impl IcebergSchemaProvider {

#[async_trait]
impl SchemaProvider for IcebergSchemaProvider {
/// Lists the tables but not their metadata tables, as Spark, Trino and Flink
/// do: `t$snapshots` resolves by name. Listing them would make
/// `information_schema` load each table again for every metadata table.
fn table_names(&self) -> Vec<String> {
self.tables
.iter()
.flat_map(|entry| {
let table_name = entry.key().clone();
[table_name.clone()].into_iter().chain(
MetadataTableType::all_types().map(move |metadata_table_name| {
format!("{}${}", table_name, metadata_table_name.as_str())
}),
)
})
.map(|entry| entry.key().clone())
.collect()
}

Expand Down
3 changes: 0 additions & 3 deletions crates/datafusion/tests/catalog_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ async fn test_provider_list_table_names() -> Result<(), Box<dyn Error>> {
insta::assert_debug_snapshot!(&result, @r#"
[
"my_table",
"my_table$snapshots",
"my_table$manifests",
"my_table$history",
]
"#);

Expand Down
9 changes: 0 additions & 9 deletions crates/sqllogictest/testdata/slts/df_test/show_tables.slt
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,8 @@ datafusion information_schema schemata VIEW
datafusion information_schema tables VIEW
datafusion information_schema views VIEW
default default test_binary_table BASE TABLE
default default test_binary_table$history BASE TABLE
default default test_binary_table$manifests BASE TABLE
default default test_binary_table$snapshots BASE TABLE
default default test_encrypted_round_trip BASE TABLE
default default test_encrypted_round_trip$history BASE TABLE
default default test_encrypted_round_trip$manifests BASE TABLE
default default test_encrypted_round_trip$snapshots BASE TABLE
default default test_partitioned_table BASE TABLE
default default test_partitioned_table$history BASE TABLE
default default test_partitioned_table$manifests BASE TABLE
default default test_partitioned_table$snapshots BASE TABLE
default information_schema columns VIEW
default information_schema df_settings VIEW
default information_schema parameters VIEW
Expand Down