diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version index d73e34fb425b..46b23e5f0e61 100644 --- a/cpp-ch/clickhouse.version +++ b/cpp-ch/clickhouse.version @@ -1,4 +1,4 @@ CH_ORG=Kyligence -CH_BRANCH=rebase_ch/20240803 -CH_COMMIT=b3cfc38f967 +CH_BRANCH=rebase_ch/20240806 +CH_COMMIT=c8a7d6e496d diff --git a/cpp-ch/local-engine/Functions/SparkFunctionPositionUTF8.cpp b/cpp-ch/local-engine/Functions/SparkFunctionPositionUTF8.cpp index 4a17c437150c..856dd6bd0957 100644 --- a/cpp-ch/local-engine/Functions/SparkFunctionPositionUTF8.cpp +++ b/cpp-ch/local-engine/Functions/SparkFunctionPositionUTF8.cpp @@ -51,7 +51,8 @@ struct PositionSparkImpl const std::string & needle, const ColumnPtr & start_pos, PaddedPODArray & res, - [[maybe_unused]] ColumnUInt8 * res_null) + [[maybe_unused]] ColumnUInt8 * res_null, + [[maybe_unused]] size_t input_rows_count) { /// `res_null` serves as an output parameter for implementing an XYZOrNull variant. assert(!res_null); @@ -163,7 +164,8 @@ struct PositionSparkImpl const ColumnString::Offsets & needle_offsets, const ColumnPtr & start_pos, PaddedPODArray & res, - [[maybe_unused]] ColumnUInt8 * res_null) + [[maybe_unused]] ColumnUInt8 * res_null, + size_t input_rows_count) { /// `res_null` serves as an output parameter for implementing an XYZOrNull variant. assert(!res_null); @@ -171,9 +173,8 @@ struct PositionSparkImpl ColumnString::Offset prev_haystack_offset = 0; ColumnString::Offset prev_needle_offset = 0; - size_t size = haystack_offsets.size(); - for (size_t i = 0; i < size; ++i) + for (size_t i = 0; i < input_rows_count; ++i) { size_t needle_size = needle_offsets[i] - prev_needle_offset - 1; size_t haystack_size = haystack_offsets[i] - prev_haystack_offset - 1; @@ -227,7 +228,8 @@ struct PositionSparkImpl const ColumnString::Offsets & needle_offsets, const ColumnPtr & start_pos, PaddedPODArray & res, - [[maybe_unused]] ColumnUInt8 * res_null) + [[maybe_unused]] ColumnUInt8 * res_null, + size_t input_rows_count) { /// `res_null` serves as an output parameter for implementing an XYZOrNull variant. assert(!res_null); @@ -235,9 +237,7 @@ struct PositionSparkImpl /// NOTE You could use haystack indexing. But this is a rare case. ColumnString::Offset prev_needle_offset = 0; - size_t size = needle_offsets.size(); - - for (size_t i = 0; i < size; ++i) + for (size_t i = 0; i < input_rows_count; ++i) { size_t needle_size = needle_offsets[i] - prev_needle_offset - 1; diff --git a/cpp-ch/local-engine/Storages/Output/OutputFormatFile.cpp b/cpp-ch/local-engine/Storages/Output/OutputFormatFile.cpp index ccb97326e866..194d997ddf82 100644 --- a/cpp-ch/local-engine/Storages/Output/OutputFormatFile.cpp +++ b/cpp-ch/local-engine/Storages/Output/OutputFormatFile.cpp @@ -61,7 +61,7 @@ Block OutputFormatFile::createHeaderWithPreferredSchema(const Block & header) ColumnWithTypeAndName column(preferred_column.type->createColumn(), preferred_column.type, preferred_column.name); columns.emplace_back(std::move(column)); } - assert(prefered_schema.columns() == index); + assert(preferred_schema.columns() == index); return {std::move(columns)}; } diff --git a/cpp-ch/local-engine/tests/benchmark_local_engine.cpp b/cpp-ch/local-engine/tests/benchmark_local_engine.cpp index fba8ef732701..839f3ea529c1 100644 --- a/cpp-ch/local-engine/tests/benchmark_local_engine.cpp +++ b/cpp-ch/local-engine/tests/benchmark_local_engine.cpp @@ -35,8 +35,6 @@ #include #include #include - -#include #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_ch_join.cpp b/cpp-ch/local-engine/tests/gtest_ch_join.cpp index 4885881f9e22..e130d82b9c7c 100644 --- a/cpp-ch/local-engine/tests/gtest_ch_join.cpp +++ b/cpp-ch/local-engine/tests/gtest_ch_join.cpp @@ -25,7 +25,7 @@ #include #include #include -#include + #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_ch_storages.cpp b/cpp-ch/local-engine/tests/gtest_ch_storages.cpp index 36c0b32ae057..7de21a26df72 100644 --- a/cpp-ch/local-engine/tests/gtest_ch_storages.cpp +++ b/cpp-ch/local-engine/tests/gtest_ch_storages.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_local_engine.cpp b/cpp-ch/local-engine/tests/gtest_local_engine.cpp index 50e527afc8d5..86cea39e5eb4 100644 --- a/cpp-ch/local-engine/tests/gtest_local_engine.cpp +++ b/cpp-ch/local-engine/tests/gtest_local_engine.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include