diff --git a/src/Interpreters/ClusterFunctionReadTask.cpp b/src/Interpreters/ClusterFunctionReadTask.cpp index 9870ef6b65bf..3843af6d0f41 100644 --- a/src/Interpreters/ClusterFunctionReadTask.cpp +++ b/src/Interpreters/ClusterFunctionReadTask.cpp @@ -19,9 +19,11 @@ namespace ErrorCodes namespace Setting { extern const SettingsBool cluster_function_process_archive_on_multiple_nodes; + extern const SettingsBool allow_experimental_iceberg_read_optimization; } ClusterFunctionReadTaskResponse::ClusterFunctionReadTaskResponse(ObjectInfoPtr object, const ContextPtr & context) + : iceberg_read_optimization_enabled(context->getSettingsRef()[Setting::allow_experimental_iceberg_read_optimization]) { if (!object) throw Exception(ErrorCodes::LOGICAL_ERROR, "`object` cannot be null"); @@ -67,7 +69,8 @@ void ClusterFunctionReadTaskResponse::serialize(WriteBuffer & out, size_t protoc if (protocol_version >= DBMS_CLUSTER_PROCESSING_PROTOCOL_VERSION_WITH_DATA_LAKE_COLUMNS_METADATA) { - if (file_meta_info.has_value()) + /// This info is not used when optimization is disabled, so there is no need to send it. + if (iceberg_read_optimization_enabled && file_meta_info.has_value()) file_meta_info.value()->serialize(out); else DataFileMetaInfo().serialize(out); diff --git a/src/Interpreters/ClusterFunctionReadTask.h b/src/Interpreters/ClusterFunctionReadTask.h index ba0fd799ab80..5c3b5912e5c7 100644 --- a/src/Interpreters/ClusterFunctionReadTask.h +++ b/src/Interpreters/ClusterFunctionReadTask.h @@ -23,6 +23,8 @@ struct ClusterFunctionReadTaskResponse /// File's columns info std::optional file_meta_info; + const bool iceberg_read_optimization_enabled = false; + /// Convert received response into ObjectInfo. ObjectInfoPtr getObjectInfo() const;