diff --git a/cpp-ch/local-engine/Common/CHUtil.cpp b/cpp-ch/local-engine/Common/CHUtil.cpp index b51683197c7ed..5ad0b1b973843 100644 --- a/cpp-ch/local-engine/Common/CHUtil.cpp +++ b/cpp-ch/local-engine/Common/CHUtil.cpp @@ -21,7 +21,6 @@ #include #include #include - #include #include #include @@ -53,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/LocalExecutor.cpp b/cpp-ch/local-engine/Parser/LocalExecutor.cpp index 1ae60e38ec26f..58c29b53c1cc5 100644 --- a/cpp-ch/local-engine/Parser/LocalExecutor.cpp +++ b/cpp-ch/local-engine/Parser/LocalExecutor.cpp @@ -18,7 +18,7 @@ #include "LocalExecutor.h" #include -#include +#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/RelParsers/CrossRelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/CrossRelParser.cpp index 99ade18028a19..0236fbbd1dd2b 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/CrossRelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/CrossRelParser.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/RelParsers/ExpandRelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/ExpandRelParser.cpp index aaf98baf2205e..451cd6ffc2a3e 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/ExpandRelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/ExpandRelParser.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/cpp-ch/local-engine/Parser/RelParsers/FetchRelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/FetchRelParser.cpp index 9594741a5e34c..d0847a5d8d548 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/FetchRelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/FetchRelParser.cpp @@ -17,9 +17,9 @@ #include #include -#include +#include #include -#include "RelParser.h" + namespace local_engine { class FetchRelParser : public RelParser diff --git a/cpp-ch/local-engine/Parser/RelParsers/JoinRelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/JoinRelParser.cpp index 39212cf8dcbf9..a5ed605ed0a20 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/JoinRelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/JoinRelParser.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.cpp index 5532baca53426..1f623ced57b1d 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.cpp @@ -17,6 +17,20 @@ #include "ReadRelParser.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace DB::ErrorCodes { diff --git a/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.h b/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.h index 8f9c578fba5e7..db3855306a555 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.h +++ b/cpp-ch/local-engine/Parser/RelParsers/ReadRelParser.h @@ -15,24 +15,12 @@ * limitations under the License. */ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include namespace local_engine { + class ReadRelParser : public RelParser { public: diff --git a/cpp-ch/local-engine/Parser/RelParsers/RelParser.cpp b/cpp-ch/local-engine/Parser/RelParsers/RelParser.cpp index 813fadbb3e9e1..dc36df0ad0f50 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/RelParser.cpp +++ b/cpp-ch/local-engine/Parser/RelParsers/RelParser.cpp @@ -17,13 +17,10 @@ #include "RelParser.h" #include -#include - #include #include #include -#include -#include +#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/RelParsers/RelParser.h b/cpp-ch/local-engine/Parser/RelParsers/RelParser.h index 2e38c30c69d1e..522dc05d39f33 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/RelParser.h +++ b/cpp-ch/local-engine/Parser/RelParsers/RelParser.h @@ -27,6 +27,7 @@ #include #include #include + namespace local_engine { /// parse a single substrait relation @@ -52,34 +53,37 @@ class RelParser inline SerializedPlanParser * getPlanParser() const { return plan_parser; } inline ContextPtr getContext() const { return plan_parser->context; } - inline String getUniqueName(const std::string & name) { return plan_parser->getUniqueName(name); } + inline String getUniqueName(const std::string & name) const { return plan_parser->getUniqueName(name); } - inline const std::unordered_map & getFunctionMapping() { return plan_parser->function_mapping; } + inline const std::unordered_map & getFunctionMapping() const { return plan_parser->function_mapping; } // Get function signature name. std::optional parseSignatureFunctionName(UInt32 function_ref); // Get coresponding function name in ClickHouse. std::optional parseFunctionName(UInt32 function_ref, const substrait::Expression_ScalarFunction & function); - const DB::ActionsDAG::Node * parseArgument(ActionsDAG & action_dag, const substrait::Expression & rel) + const DB::ActionsDAG::Node * parseArgument(ActionsDAG & action_dag, const substrait::Expression & rel) const { return plan_parser->parseExpression(action_dag, rel); } - const DB::ActionsDAG::Node * parseExpression(ActionsDAG & action_dag, const substrait::Expression & rel) + const DB::ActionsDAG::Node * parseExpression(ActionsDAG & action_dag, const substrait::Expression & rel) const { return plan_parser->parseExpression(action_dag, rel); } - DB::ActionsDAG expressionsToActionsDAG(const std::vector & expressions, const DB::Block & header) + DB::ActionsDAG expressionsToActionsDAG(const std::vector & expressions, const DB::Block & header) const { return plan_parser->expressionsToActionsDAG(expressions, header, header); } - std::pair parseLiteral(const substrait::Expression_Literal & literal) { return plan_parser->parseLiteral(literal); } + std::pair parseLiteral(const substrait::Expression_Literal & literal) const + { + return plan_parser->parseLiteral(literal); + } // collect all steps for metrics std::vector steps; const ActionsDAG::Node * - buildFunctionNode(ActionsDAG & action_dag, const String & function, const DB::ActionsDAG::NodeRawConstPtrs & args) + buildFunctionNode(ActionsDAG & action_dag, const String & function, const DB::ActionsDAG::NodeRawConstPtrs & args) const { return plan_parser->toFunctionNode(action_dag, function, args); } diff --git a/cpp-ch/local-engine/Parser/RelParsers/WindowGroupLimitRelParser.h b/cpp-ch/local-engine/Parser/RelParsers/WindowGroupLimitRelParser.h index 7939d232ce9e8..6e0ef27f4e6ea 100644 --- a/cpp-ch/local-engine/Parser/RelParsers/WindowGroupLimitRelParser.h +++ b/cpp-ch/local-engine/Parser/RelParsers/WindowGroupLimitRelParser.h @@ -17,7 +17,6 @@ #pragma once #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp index aa4bf5aac4045..c1f00c334812a 100644 --- a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp +++ b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp @@ -85,7 +85,6 @@ #include #include #include -#include "RelParsers/RelParser.h" namespace DB { diff --git a/cpp-ch/local-engine/Shuffle/PartitionWriter.h b/cpp-ch/local-engine/Shuffle/PartitionWriter.h index 43f9987cf564d..80bb43b8d196c 100644 --- a/cpp-ch/local-engine/Shuffle/PartitionWriter.h +++ b/cpp-ch/local-engine/Shuffle/PartitionWriter.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -68,7 +67,7 @@ friend class Spillable; PartitionWriter(const SplitOptions& options, LoggerPtr logger_); virtual ~PartitionWriter() = default; - void initialize(SplitResult * split_result_, const Block & output_header_) + void initialize(SplitResult * split_result_, const DB::Block & output_header_) { if (!init) { @@ -107,8 +106,8 @@ friend class Spillable; /// Only valid in celeborn partition writer size_t last_partition_id; - SplitResult* split_result = nullptr; - Block output_header; + SplitResult * split_result = nullptr; + DB::Block output_header; LoggerPtr logger = nullptr; bool init = false; }; diff --git a/cpp-ch/local-engine/Shuffle/ShuffleCommon.cpp b/cpp-ch/local-engine/Shuffle/ShuffleCommon.cpp index e0d8c0e84eaa4..418571874a305 100644 --- a/cpp-ch/local-engine/Shuffle/ShuffleCommon.cpp +++ b/cpp-ch/local-engine/Shuffle/ShuffleCommon.cpp @@ -16,7 +16,6 @@ */ #include #include -#include #include namespace local_engine diff --git a/cpp-ch/local-engine/tests/gluten_test_util.cpp b/cpp-ch/local-engine/tests/gluten_test_util.cpp index 66ce81a509a66..5e7e762d1e581 100644 --- a/cpp-ch/local-engine/tests/gluten_test_util.cpp +++ b/cpp-ch/local-engine/tests/gluten_test_util.cpp @@ -21,6 +21,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 a3454f9b09599..28cea800ea93b 100644 --- a/cpp-ch/local-engine/tests/gtest_ch_storages.cpp +++ b/cpp-ch/local-engine/tests/gtest_ch_storages.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ #include -#include +#include #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_clickhouse_pr_verify.cpp b/cpp-ch/local-engine/tests/gtest_clickhouse_pr_verify.cpp index 012b4ebdddfcb..b44fe5eae0f55 100644 --- a/cpp-ch/local-engine/tests/gtest_clickhouse_pr_verify.cpp +++ b/cpp-ch/local-engine/tests/gtest_clickhouse_pr_verify.cpp @@ -18,6 +18,7 @@ #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 558f0df7a7640..fd88075704ba2 100644 --- a/cpp-ch/local-engine/tests/gtest_local_engine.cpp +++ b/cpp-ch/local-engine/tests/gtest_local_engine.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_parquet_columnindex.cpp b/cpp-ch/local-engine/tests/gtest_parquet_columnindex.cpp index 48ea16a4bc6f8..ac0ec2145757c 100644 --- a/cpp-ch/local-engine/tests/gtest_parquet_columnindex.cpp +++ b/cpp-ch/local-engine/tests/gtest_parquet_columnindex.cpp @@ -14,26 +14,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - #include "config.h" #if USE_PARQUET #include #include #include #include -#include +#include #include #include #include -#include #include -#include #include #include #include #include #include +#include #include #include #include @@ -42,7 +39,6 @@ #include #include - # define ASSERT_DURATION_LE(secs, stmt) \ { \ std::promise completed; \ diff --git a/cpp-ch/local-engine/tests/gtest_parquet_columnindex_bug.cpp b/cpp-ch/local-engine/tests/gtest_parquet_columnindex_bug.cpp index 5e2be65528fe0..51a5a0556ea82 100644 --- a/cpp-ch/local-engine/tests/gtest_parquet_columnindex_bug.cpp +++ b/cpp-ch/local-engine/tests/gtest_parquet_columnindex_bug.cpp @@ -18,9 +18,10 @@ #include #include #include -#include +#include #include #include +#include #include #include #include diff --git a/cpp-ch/local-engine/tests/gtest_parquet_read.cpp b/cpp-ch/local-engine/tests/gtest_parquet_read.cpp index e113438344596..1cbe34319d84d 100644 --- a/cpp-ch/local-engine/tests/gtest_parquet_read.cpp +++ b/cpp-ch/local-engine/tests/gtest_parquet_read.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -32,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +42,7 @@ #include #include #include +#include using namespace DB; diff --git a/cpp-ch/local-engine/tests/gtest_parser.cpp b/cpp-ch/local-engine/tests/gtest_parser.cpp index 5f8d482d58287..b6c431ff25f35 100644 --- a/cpp-ch/local-engine/tests/gtest_parser.cpp +++ b/cpp-ch/local-engine/tests/gtest_parser.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -45,8 +46,8 @@ TEST(LocalExecutor, ReadCSV) auto plan = local_engine::JsonStringToMessage(EMBEDDED_PLAN(_readcsv_plan)); auto query_plan = parser.parse(plan); - const auto pipeline = parser.buildQueryPipeline(*query_plan); - LocalExecutor local_executor{std::move(query_plan), QueryPipelineBuilder::getPipeline(std::move(*pipeline))}; + auto pipeline = parser.buildQueryPipeline(*query_plan); + LocalExecutor local_executor{std::move(query_plan), std::move(pipeline)}; EXPECT_TRUE(local_executor.hasNext()); const Block & x = *local_executor.nextColumnar(); diff --git a/cpp-ch/local-engine/tests/gtest_write_pipeline.cpp b/cpp-ch/local-engine/tests/gtest_write_pipeline.cpp index 3db6f2fd4cb9b..18a18b0e2cbfc 100644 --- a/cpp-ch/local-engine/tests/gtest_write_pipeline.cpp +++ b/cpp-ch/local-engine/tests/gtest_write_pipeline.cpp @@ -19,18 +19,20 @@ #include #include #include +#include #include #include #include #include -#include +#include +#include #include #include -#include #include #include #include #include +#include #include #include #include @@ -40,6 +42,7 @@ #include #include #include +#include #include #include #include