From 5a79dc9ba66c6b3a8da5142e0d1ab462d3d39cfe Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Wed, 21 Aug 2024 10:44:44 +0800 Subject: [PATCH] More refine --- dbms/src/Debug/MockExecutor/AstToPB.cpp | 2 +- dbms/src/Debug/MockExecutor/AstToPB.h | 2 +- dbms/src/Debug/MockExecutor/ExpandBinder2.cpp | 6 +++--- dbms/src/Debug/MockExecutor/ExpandBinder2.h | 2 +- dbms/src/Functions/tests/gtest_cast_as_json.cpp | 2 +- dbms/src/Functions/tests/gtest_cast_json_as_string.cpp | 2 +- dbms/src/Functions/tests/gtest_json_array.cpp | 2 +- dbms/src/Parsers/IAST_fwd.h | 1 - dbms/src/Storages/KVStore/KVStore.h | 6 +----- dbms/src/TestUtils/mockExecutor.cpp | 2 +- dbms/src/TiDB/Schema/SchemaSyncService.h | 4 +--- 11 files changed, 12 insertions(+), 19 deletions(-) diff --git a/dbms/src/Debug/MockExecutor/AstToPB.cpp b/dbms/src/Debug/MockExecutor/AstToPB.cpp index 3b2ac7238e8..4756e046473 100644 --- a/dbms/src/Debug/MockExecutor/AstToPB.cpp +++ b/dbms/src/Debug/MockExecutor/AstToPB.cpp @@ -694,7 +694,7 @@ TiDB::ColumnInfo compileExpr(const DAGSchema & input, ASTPtr ast) } } -void compileFilter(const DAGSchema & input, ASTPtr ast, std::vector & conditions) +void compileFilter(const DAGSchema & input, ASTPtr ast, ASTs & conditions) { if (auto * func = typeid_cast(ast.get())) { diff --git a/dbms/src/Debug/MockExecutor/AstToPB.h b/dbms/src/Debug/MockExecutor/AstToPB.h index e143c7624e1..2b9e712d370 100644 --- a/dbms/src/Debug/MockExecutor/AstToPB.h +++ b/dbms/src/Debug/MockExecutor/AstToPB.h @@ -101,7 +101,7 @@ void identifierToPB(const DAGSchema & input, ASTIdentifier * id, tipb::Expr * ex void astToPB(const DAGSchema & input, ASTPtr ast, tipb::Expr * expr, int32_t collator_id, const Context & context); void collectUsedColumnsFromExpr(const DAGSchema & input, ASTPtr ast, std::unordered_set & used_columns); TiDB::ColumnInfo compileExpr(const DAGSchema & input, ASTPtr ast); -void compileFilter(const DAGSchema & input, ASTPtr ast, std::vector & conditions); +void compileFilter(const DAGSchema & input, ASTPtr ast, ASTs & conditions); void fillTaskMetaWithMPPInfo(mpp::TaskMeta & task_meta, const MPPInfo & mpp_info); } // namespace DB diff --git a/dbms/src/Debug/MockExecutor/ExpandBinder2.cpp b/dbms/src/Debug/MockExecutor/ExpandBinder2.cpp index 9ed3ebd630c..729324d9812 100644 --- a/dbms/src/Debug/MockExecutor/ExpandBinder2.cpp +++ b/dbms/src/Debug/MockExecutor/ExpandBinder2.cpp @@ -57,17 +57,17 @@ bool ExpandBinder2::toTiPBExecutor( ExecutorBinderPtr compileExpand2( ExecutorBinderPtr input, size_t & executor_index, - ASTPtrVec level_select_list, + ASTs level_select_list, std::vector output_names, std::vector fts) { DAGSchema output_schema; - std::vector> expand_exprs; + std::vector expand_exprs; auto input_col_size = input->output_schema.size(); for (size_t i = 0; i < level_select_list.size(); i++) { auto level_proj = level_select_list[i]; - std::vector level_exprs; + ASTs level_exprs; for (size_t j = 0; j < level_proj->children.size(); j++) { auto expr = level_proj->children[j]; diff --git a/dbms/src/Debug/MockExecutor/ExpandBinder2.h b/dbms/src/Debug/MockExecutor/ExpandBinder2.h index b2d4eddf1ec..e76d98aa731 100644 --- a/dbms/src/Debug/MockExecutor/ExpandBinder2.h +++ b/dbms/src/Debug/MockExecutor/ExpandBinder2.h @@ -51,7 +51,7 @@ class ExpandBinder2 : public ExecutorBinder ExecutorBinderPtr compileExpand2( ExecutorBinderPtr input, size_t & executor_index, - std::vector level_select_list, + ASTs level_select_list, std::vector output_names, std::vector fts); } // namespace DB::mock diff --git a/dbms/src/Functions/tests/gtest_cast_as_json.cpp b/dbms/src/Functions/tests/gtest_cast_as_json.cpp index 0b04a07f44e..5dbf8308db9 100644 --- a/dbms/src/Functions/tests/gtest_cast_as_json.cpp +++ b/dbms/src/Functions/tests/gtest_cast_as_json.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/dbms/src/Functions/tests/gtest_cast_json_as_string.cpp b/dbms/src/Functions/tests/gtest_cast_json_as_string.cpp index 8a923aa1c52..e588aaa7987 100644 --- a/dbms/src/Functions/tests/gtest_cast_json_as_string.cpp +++ b/dbms/src/Functions/tests/gtest_cast_json_as_string.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace DB::tests { diff --git a/dbms/src/Functions/tests/gtest_json_array.cpp b/dbms/src/Functions/tests/gtest_json_array.cpp index 963868a912e..ff41a45a72a 100644 --- a/dbms/src/Functions/tests/gtest_json_array.cpp +++ b/dbms/src/Functions/tests/gtest_json_array.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include namespace DB::tests { diff --git a/dbms/src/Parsers/IAST_fwd.h b/dbms/src/Parsers/IAST_fwd.h index c31f01b03a4..f41660d59b5 100644 --- a/dbms/src/Parsers/IAST_fwd.h +++ b/dbms/src/Parsers/IAST_fwd.h @@ -23,7 +23,6 @@ namespace DB class IAST; using ASTPtr = std::shared_ptr; using ASTs = std::vector; -using ASTPtrVec = std::vector; } // namespace DB diff --git a/dbms/src/Storages/KVStore/KVStore.h b/dbms/src/Storages/KVStore/KVStore.h index f03a9f9e7fd..b7875714832 100644 --- a/dbms/src/Storages/KVStore/KVStore.h +++ b/dbms/src/Storages/KVStore/KVStore.h @@ -15,6 +15,7 @@ #pragma once #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include -#include #include namespace TiDB @@ -49,10 +49,6 @@ namespace tests class KVStoreTestBase; } // namespace tests -class IAST; -using ASTPtr = std::shared_ptr; -using ASTs = std::vector; - class KVStore; using KVStorePtr = std::shared_ptr; diff --git a/dbms/src/TestUtils/mockExecutor.cpp b/dbms/src/TestUtils/mockExecutor.cpp index 1f0ecb2ef8d..744fe54c509 100644 --- a/dbms/src/TestUtils/mockExecutor.cpp +++ b/dbms/src/TestUtils/mockExecutor.cpp @@ -59,7 +59,7 @@ ASTPtr buildLiteral(const Field & field) ASTPtr buildOrderByItemVec(MockOrderByItemVec order_by_items) { - std::vector vec(order_by_items.size()); + MockAstVec vec(order_by_items.size()); size_t i = 0; for (auto item : order_by_items) { diff --git a/dbms/src/TiDB/Schema/SchemaSyncService.h b/dbms/src/TiDB/Schema/SchemaSyncService.h index e2c0b572c0d..f55f98bbaea 100644 --- a/dbms/src/TiDB/Schema/SchemaSyncService.h +++ b/dbms/src/TiDB/Schema/SchemaSyncService.h @@ -15,6 +15,7 @@ #pragma once #include +#include #include #include @@ -33,9 +34,6 @@ class SchemaSyncTest; class Logger; using LoggerPtr = std::shared_ptr; -class IAST; -using ASTPtr = std::shared_ptr; -using ASTs = std::vector; using DBGInvokerPrinter = std::function; extern void dbgFuncGcSchemas(Context &, const ASTs &, DBGInvokerPrinter);