From 573a53cb283c273d7b98129ff6b18c1e67f41e0f Mon Sep 17 00:00:00 2001 From: Chang Chen Date: Thu, 18 Jul 2024 08:38:14 +0800 Subject: [PATCH] Fix build due to https://github.com/ClickHouse/ClickHouse/pull/66144 --- .../local-engine/Operator/DefaultHashAggregateResult.cpp | 6 +++--- .../Storages/Mergetree/SparkMergeTreeWriter.cpp | 7 +++---- .../local-engine/Storages/Mergetree/SparkMergeTreeWriter.h | 2 +- cpp-ch/local-engine/Storages/SourceFromJavaIter.cpp | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cpp-ch/local-engine/Operator/DefaultHashAggregateResult.cpp b/cpp-ch/local-engine/Operator/DefaultHashAggregateResult.cpp index 35f8915815950..fbad02fda5926 100644 --- a/cpp-ch/local-engine/Operator/DefaultHashAggregateResult.cpp +++ b/cpp-ch/local-engine/Operator/DefaultHashAggregateResult.cpp @@ -116,7 +116,7 @@ class DefaultHashAggrgateResultTransform : public DB::IProcessor has_input = true; output_chunk = DB::Chunk(result_cols, 1); auto info = std::make_shared(); - output_chunk.setChunkInfo(info); + output_chunk.getChunkInfos().add(std::move(info)); return Status::Ready; } @@ -124,10 +124,10 @@ class DefaultHashAggrgateResultTransform : public DB::IProcessor if (input.hasData()) { output_chunk = input.pull(true); - if (!output_chunk.hasChunkInfo()) + if (output_chunk.getChunkInfos().empty()) { auto info = std::make_shared(); - output_chunk.setChunkInfo(info); + output_chunk.getChunkInfos().add(std::move(info)); } has_input = true; return Status::Ready; diff --git a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp index 406f2aaa23df2..2f673fc386e8f 100644 --- a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp +++ b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp @@ -121,12 +121,11 @@ void SparkMergeTreeWriter::write(const DB::Block & block) checkAndMerge(); } -bool SparkMergeTreeWriter::chunkToPart(Chunk && chunk) +bool SparkMergeTreeWriter::chunkToPart(Chunk && plan_chunk) { - if (chunk.hasChunkInfo()) + if (Chunk result_chunk = DB::Squashing::squash(std::move(plan_chunk))) { - Chunk squash_chunk = DB::Squashing::squash(std::move(chunk)); - Block result = header.cloneWithColumns(squash_chunk.getColumns()); + auto result = squashing->getHeader().cloneWithColumns(result_chunk.detachColumns()); return blockToPart(result); } return false; diff --git a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.h b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.h index 13ac223944775..269b0352c0566 100644 --- a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.h +++ b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.h @@ -77,7 +77,7 @@ class SparkMergeTreeWriter void saveMetadata(); void commitPartToRemoteStorageIfNeeded(); void finalizeMerge(); - bool chunkToPart(Chunk && chunk); + bool chunkToPart(Chunk && plan_chunk); bool blockToPart(Block & block); bool useLocalStorage() const; diff --git a/cpp-ch/local-engine/Storages/SourceFromJavaIter.cpp b/cpp-ch/local-engine/Storages/SourceFromJavaIter.cpp index 37501e98504a0..1c5902c8ca67b 100644 --- a/cpp-ch/local-engine/Storages/SourceFromJavaIter.cpp +++ b/cpp-ch/local-engine/Storages/SourceFromJavaIter.cpp @@ -109,13 +109,13 @@ DB::Chunk SourceFromJavaIter::generate() auto info = std::make_shared(); info->is_overflows = data->info.is_overflows; info->bucket_num = data->info.bucket_num; - result.setChunkInfo(info); + result.getChunkInfos().add(std::move(info)); } else { result = BlockUtil::buildRowCountChunk(rows); auto info = std::make_shared(); - result.setChunkInfo(info); + result.getChunkInfos().add(std::move(info)); } } return result;