diff --git a/crates/datafusion/src/catalog/schema.rs b/crates/datafusion/src/catalog/schema.rs index 40492e6..5efd4b9 100644 --- a/crates/datafusion/src/catalog/schema.rs +++ b/crates/datafusion/src/catalog/schema.rs @@ -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 { 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() } diff --git a/crates/datafusion/tests/catalog_provider.rs b/crates/datafusion/tests/catalog_provider.rs index 90f6967..58e6bbb 100644 --- a/crates/datafusion/tests/catalog_provider.rs +++ b/crates/datafusion/tests/catalog_provider.rs @@ -134,9 +134,6 @@ async fn test_provider_list_table_names() -> Result<(), Box> { insta::assert_debug_snapshot!(&result, @r#" [ "my_table", - "my_table$snapshots", - "my_table$manifests", - "my_table$history", ] "#); diff --git a/crates/sqllogictest/testdata/slts/df_test/show_tables.slt b/crates/sqllogictest/testdata/slts/df_test/show_tables.slt index 29cc3cd..25711ad 100644 --- a/crates/sqllogictest/testdata/slts/df_test/show_tables.slt +++ b/crates/sqllogictest/testdata/slts/df_test/show_tables.slt @@ -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