diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version index 9a3f82356ef0..8ff055d4bdda 100644 --- a/cpp-ch/clickhouse.version +++ b/cpp-ch/clickhouse.version @@ -1,3 +1,3 @@ CH_ORG=Kyligence -CH_BRANCH=rebase_ch/20240315 -CH_COMMIT=1240fda3f62 \ No newline at end of file +CH_BRANCH=rebase_ch/20240319 +CH_COMMIT=06814835aa8 \ No newline at end of file diff --git a/cpp-ch/local-engine/Common/CHUtil.cpp b/cpp-ch/local-engine/Common/CHUtil.cpp index 96b65c7248d3..1d69f76a6da2 100644 --- a/cpp-ch/local-engine/Common/CHUtil.cpp +++ b/cpp-ch/local-engine/Common/CHUtil.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Functions/SparkFunctionGetJsonObject.h b/cpp-ch/local-engine/Functions/SparkFunctionGetJsonObject.h index d2d551a62018..d9411813b86f 100644 --- a/cpp-ch/local-engine/Functions/SparkFunctionGetJsonObject.h +++ b/cpp-ch/local-engine/Functions/SparkFunctionGetJsonObject.h @@ -267,7 +267,8 @@ class FlattenJSONStringOnRequiredFunction : public DB::IFunction const char * query_end = required_fields.back().c_str() + required_fields.back().size(); DB::Tokens tokens(query_begin, query_end); UInt32 max_parser_depth = static_cast(context->getSettingsRef().max_parser_depth); - DB::IParser::Pos token_iterator(tokens, max_parser_depth); + UInt32 max_parser_backtracks = static_cast(context->getSettingsRef().max_parser_backtracks); + DB::IParser::Pos token_iterator(tokens, max_parser_depth, max_parser_backtracks); DB::ASTPtr json_path_ast; DB::ParserJSONPath path_parser; DB::Expected expected; diff --git a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp index 405f9d6cb3d2..9f6ea0b01f52 100644 --- a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp +++ b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp index 3184dd19ef2a..f5c9a1338f14 100644 --- a/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp +++ b/cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp @@ -47,32 +47,26 @@ void SparkMergeTreeWriter::write(DB::Block & block) ExpressionActions do_convert = ExpressionActions(converter); do_convert.execute(new_block); } - auto res = squashing_transform->add(new_block); - if (res) + + auto blocks_with_partition = MergeTreeDataWriter::splitBlockIntoParts(squashing_transform->add(new_block), 10, metadata_snapshot, context); + for (auto & item : blocks_with_partition) { - auto blocks_with_partition = MergeTreeDataWriter::splitBlockIntoParts(res, 10, metadata_snapshot, context); - for (auto & item : blocks_with_partition) - { - auto temp_part = writeTempPart(item, metadata_snapshot, context); - temp_part.finalize(); - new_parts.emplace_back(temp_part.part); - part_num++; - } + auto temp_part = writeTempPart(item, metadata_snapshot, context); + temp_part.finalize(); + new_parts.emplace_back(temp_part.part); + part_num++; } } void SparkMergeTreeWriter::finalize() { - auto block = squashing_transform->add({}); - if (block.rows()) + + auto blocks_with_partition = MergeTreeDataWriter::splitBlockIntoParts(squashing_transform->add({}), 10, metadata_snapshot, context); + for (auto & item : blocks_with_partition) { - auto blocks_with_partition = MergeTreeDataWriter::splitBlockIntoParts(block, 10, metadata_snapshot, context); - for (auto & item : blocks_with_partition) - { - auto temp_part = writeTempPart(item, metadata_snapshot, context); - temp_part.finalize(); - new_parts.emplace_back(temp_part.part); - } + auto temp_part = writeTempPart(item, metadata_snapshot, context); + temp_part.finalize(); + new_parts.emplace_back(temp_part.part); } } diff --git a/cpp-ch/local-engine/tests/benchmark_cast_float_function.cpp b/cpp-ch/local-engine/tests/benchmark_cast_float_function.cpp index cb8d9ead681b..a1ca08e13ab5 100644 --- a/cpp-ch/local-engine/tests/benchmark_cast_float_function.cpp +++ b/cpp-ch/local-engine/tests/benchmark_cast_float_function.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include