diff --git a/src/planning/iceberg_multi_file_list.cpp b/src/planning/iceberg_multi_file_list.cpp index 7ca89f7e6..28784a7bc 100644 --- a/src/planning/iceberg_multi_file_list.cpp +++ b/src/planning/iceberg_multi_file_list.cpp @@ -353,10 +353,6 @@ void IcebergMultiFileList::Bind(vector &return_types, vectorname)); @@ -466,10 +462,6 @@ vector IcebergMultiFileList::GetAllFiles() const { } FileExpandResult IcebergMultiFileList::GetExpandResult() const { - // GetFileInternal(1) will ensure files with index 0 and index 1 are expanded if they are available - lock_guard guard(shared_state->lock); - GetFileInternal(1, guard); - // always return multiple files, In the case there is only 1 data file, // we only lose performance if it is small return FileExpandResult::MULTIPLE_FILES; @@ -493,9 +485,10 @@ unique_ptr IcebergMultiFileList::GetCardinality(ClientContext &c return nullptr; } - //! Make sure we have fetched all manifests - (void)GetTotalFileCount(); - D_ASSERT(view_initialized); + if (!view_initialized) { + //! Avoid forcing manifest initialization before filter pushdown has had a chance to narrow the table. + return nullptr; + } idx_t cardinality = 0; for (idx_t i = 0; i < data_manifests.size(); i++) { @@ -545,6 +538,11 @@ void IcebergMultiFileList::GetStatistics(vector &result) co return; } + if (!view_initialized) { + //! Avoid forcing manifest initialization before filter pushdown has had a chance to narrow the table. + return; + } + for (idx_t i = 0; i < delete_manifests.size(); i++) { if (delete_manifest_matches[i]) { //! if a matching delete manifest exists, return; diff --git a/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test b/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test index 05be638e3..ece12432d 100644 --- a/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test +++ b/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test @@ -78,8 +78,6 @@ with cte as ( ) select CASE WHEN contains(val, '.') THEN (split(val, '.')[2]) ELSE NULL END FROM CTE ORDER BY ALL ---- -avro -avro NULL statement ok @@ -126,6 +124,8 @@ with cte as ( ) select CASE WHEN contains(val, '.') THEN (split(val, '.')[2]) ELSE NULL END FROM CTE ORDER BY ALL ---- +avro +avro parquet NULL