From 09d4492e868649e56f7b7c7422b8df9551ba57bd Mon Sep 17 00:00:00 2001 From: Grant Holly Date: Fri, 17 Apr 2026 21:22:49 +0000 Subject: [PATCH 1/2] Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/102825 with unresolved conflict markers (resolution in next commit) --- Original cherry-pick message follows: Merge pull request #102825 from grantholly-clickhouse/fix_iceberg_parquet_lru_cache normalizing format check using lower case # Conflicts: # src/Storages/ObjectStorage/StorageObjectStorageSource.cpp --- src/Storages/ObjectStorage/StorageObjectStorageSource.cpp | 4 ++++ .../test_filesystem_cache.py | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp index 07ef358d0396..befe9623f05a 100644 --- a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp +++ b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp @@ -889,7 +889,11 @@ StorageObjectStorageSource::ReaderHolder StorageObjectStorageSource::createReade InputFormatPtr input_format; if (context_->getSettingsRef()[Setting::use_parquet_metadata_cache] && use_native_reader_v3 +<<<<<<< HEAD && (object_info->getFileFormat().value_or(configuration->getFormat()) == "Parquet") +======= + && (Poco::toLower(object_info->getFileFormat().value_or(configuration->format)) == "parquet") +>>>>>>> 393b84e8cbc (Merge pull request #102825 from grantholly-clickhouse/fix_iceberg_parquet_lru_cache) && !object_info->getObjectMetadata()->etag.empty()) { std::optional object_with_metadata = object_info->relative_path_with_metadata; diff --git a/tests/integration/test_storage_iceberg_with_spark_cache/test_filesystem_cache.py b/tests/integration/test_storage_iceberg_with_spark_cache/test_filesystem_cache.py index 5d716f66e8c7..cd8227919dba 100644 --- a/tests/integration/test_storage_iceberg_with_spark_cache/test_filesystem_cache.py +++ b/tests/integration/test_storage_iceberg_with_spark_cache/test_filesystem_cache.py @@ -63,6 +63,7 @@ def test_filesystem_cache(started_cluster_iceberg_with_spark, storage_type): instance.query( f"SELECT * FROM {TABLE_NAME} SETTINGS filesystem_cache_name = 'cache1'", query_id=query_id, + settings={"use_parquet_metadata_cache": "0"} ) instance.query("SYSTEM FLUSH LOGS") From 34750777806dc0e657e750822401efc331b74ef3 Mon Sep 17 00:00:00 2001 From: Andrey Zvonov Date: Fri, 15 May 2026 21:32:38 +0200 Subject: [PATCH 2/2] Resolve conflicts in cherry-pick of #102825 --- src/Storages/ObjectStorage/StorageObjectStorageSource.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp index befe9623f05a..85906ec18d48 100644 --- a/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp +++ b/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp @@ -50,6 +50,7 @@ #include #include #include +#include namespace fs = std::filesystem; namespace ProfileEvents @@ -889,11 +890,7 @@ StorageObjectStorageSource::ReaderHolder StorageObjectStorageSource::createReade InputFormatPtr input_format; if (context_->getSettingsRef()[Setting::use_parquet_metadata_cache] && use_native_reader_v3 -<<<<<<< HEAD - && (object_info->getFileFormat().value_or(configuration->getFormat()) == "Parquet") -======= - && (Poco::toLower(object_info->getFileFormat().value_or(configuration->format)) == "parquet") ->>>>>>> 393b84e8cbc (Merge pull request #102825 from grantholly-clickhouse/fix_iceberg_parquet_lru_cache) + && (Poco::toLower(object_info->getFileFormat().value_or(configuration->getFormat())) == "parquet") && !object_info->getObjectMetadata()->etag.empty()) { std::optional object_with_metadata = object_info->relative_path_with_metadata;