Skip to content

Commit 787a51e

Browse files
committed
Use allow_experimental_iceberg_read_optimization in serialize
1 parent ff7562b commit 787a51e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Interpreters/ClusterFunctionReadTask.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ ClusterFunctionReadTaskResponse::ClusterFunctionReadTaskResponse(ObjectInfoPtr o
3030
if (object->data_lake_metadata.has_value())
3131
data_lake_metadata = object->data_lake_metadata.value();
3232

33-
if (context->getSettingsRef()[Setting::allow_experimental_iceberg_read_optimization])
34-
file_meta_info = object->file_meta_info;
33+
file_meta_info = object->file_meta_info;
34+
35+
iceberg_read_optimization_enabled = context->getSettingsRef()[Setting::allow_experimental_iceberg_read_optimization];
3536

3637
const bool send_over_whole_archive = !context->getSettingsRef()[Setting::cluster_function_process_archive_on_multiple_nodes];
3738
path = send_over_whole_archive ? object->getPathOrPathToArchiveIfArchive() : object->getPath();
@@ -69,7 +70,8 @@ void ClusterFunctionReadTaskResponse::serialize(WriteBuffer & out, size_t protoc
6970

7071
if (protocol_version >= DBMS_CLUSTER_PROCESSING_PROTOCOL_VERSION_WITH_DATA_LAKE_COLUMNS_METADATA)
7172
{
72-
if (file_meta_info.has_value())
73+
/// This info is not used when optimization is disabled, so there is no need to send it.
74+
if (iceberg_read_optimization_enabled && file_meta_info.has_value())
7375
file_meta_info.value()->serialize(out);
7476
else
7577
DataFileMetaInfo().serialize(out);

src/Interpreters/ClusterFunctionReadTask.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ struct ClusterFunctionReadTaskResponse
2323
/// File's columns info
2424
std::optional<DataFileMetaInfoPtr> file_meta_info;
2525

26+
bool iceberg_read_optimization_enabled;
27+
2628
/// Convert received response into ObjectInfo.
2729
ObjectInfoPtr getObjectInfo() const;
2830

0 commit comments

Comments
 (0)