Skip to content

Commit

Permalink
More refine
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySon-Huang committed Aug 21, 2024
1 parent 6a6faba commit 5a79dc9
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dbms/src/Debug/MockExecutor/AstToPB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ TiDB::ColumnInfo compileExpr(const DAGSchema & input, ASTPtr ast)
}
}

void compileFilter(const DAGSchema & input, ASTPtr ast, std::vector<ASTPtr> & conditions)
void compileFilter(const DAGSchema & input, ASTPtr ast, ASTs & conditions)
{
if (auto * func = typeid_cast<ASTFunction *>(ast.get()))
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Debug/MockExecutor/AstToPB.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> & used_columns);
TiDB::ColumnInfo compileExpr(const DAGSchema & input, ASTPtr ast);
void compileFilter(const DAGSchema & input, ASTPtr ast, std::vector<ASTPtr> & conditions);
void compileFilter(const DAGSchema & input, ASTPtr ast, ASTs & conditions);
void fillTaskMetaWithMPPInfo(mpp::TaskMeta & task_meta, const MPPInfo & mpp_info);

} // namespace DB
6 changes: 3 additions & 3 deletions dbms/src/Debug/MockExecutor/ExpandBinder2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> output_names,
std::vector<tipb::FieldType> fts)
{
DAGSchema output_schema;
std::vector<std::vector<ASTPtr>> expand_exprs;
std::vector<ASTs> 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<ASTPtr> level_exprs;
ASTs level_exprs;
for (size_t j = 0; j < level_proj->children.size(); j++)
{
auto expr = level_proj->children[j];
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Debug/MockExecutor/ExpandBinder2.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ExpandBinder2 : public ExecutorBinder
ExecutorBinderPtr compileExpand2(
ExecutorBinderPtr input,
size_t & executor_index,
std::vector<ASTPtr> level_select_list,
ASTs level_select_list,
std::vector<String> output_names,
std::vector<tipb::FieldType> fts);
} // namespace DB::mock
2 changes: 1 addition & 1 deletion dbms/src/Functions/tests/gtest_cast_as_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <TestUtils/FunctionTestUtils.h>
#include <TestUtils/TiFlashTestBasic.h>
#include <TiDB/Decode/JsonBinary.h>
#include <TiDB/Schema/TiDB.h>
#include <TiDB/Schema/TiDBTypes.h>
#include <gtest/gtest.h>

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Functions/tests/gtest_cast_json_as_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <TestUtils/FunctionTestUtils.h>
#include <TestUtils/TiFlashTestBasic.h>
#include <TiDB/Decode/JsonBinary.h>
#include <TiDB/Schema/TiDB.h>
#include <TiDB/Schema/TiDBTypes.h>

namespace DB::tests
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Functions/tests/gtest_json_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <TestUtils/FunctionTestUtils.h>
#include <TestUtils/TiFlashTestBasic.h>
#include <TiDB/Decode/JsonBinary.h>
#include <TiDB/Schema/TiDB.h>
#include <TiDB/Schema/TiDBTypes.h>

namespace DB::tests
{
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Parsers/IAST_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace DB
class IAST;
using ASTPtr = std::shared_ptr<IAST>;
using ASTs = std::vector<ASTPtr>;
using ASTPtrVec = std::vector<ASTPtr>;


} // namespace DB
6 changes: 1 addition & 5 deletions dbms/src/Storages/KVStore/KVStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include <Interpreters/Context_fwd.h>
#include <Parsers/IAST_fwd.h>
#include <Storages/DeltaMerge/DeltaMergeInterfaces.h>
#include <Storages/DeltaMerge/RowKeyRange.h>
#include <Storages/KVStore/Decode/RegionDataRead.h>
Expand All @@ -25,7 +26,6 @@
#include <Storages/KVStore/MultiRaft/RegionRangeKeys.h>
#include <Storages/KVStore/StorageEngineType.h>

#include <condition_variable>
#include <magic_enum.hpp>

namespace TiDB
Expand All @@ -49,10 +49,6 @@ namespace tests
class KVStoreTestBase;
} // namespace tests

class IAST;
using ASTPtr = std::shared_ptr<IAST>;
using ASTs = std::vector<ASTPtr>;

class KVStore;
using KVStorePtr = std::shared_ptr<KVStore>;

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/TestUtils/mockExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ASTPtr buildLiteral(const Field & field)

ASTPtr buildOrderByItemVec(MockOrderByItemVec order_by_items)
{
std::vector<ASTPtr> vec(order_by_items.size());
MockAstVec vec(order_by_items.size());
size_t i = 0;
for (auto item : order_by_items)
{
Expand Down
4 changes: 1 addition & 3 deletions dbms/src/TiDB/Schema/SchemaSyncService.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include <Interpreters/Context_fwd.h>
#include <Parsers/IAST_fwd.h>
#include <Storages/BackgroundProcessingPool.h>
#include <Storages/KVStore/Types.h>

Expand All @@ -33,9 +34,6 @@ class SchemaSyncTest;
class Logger;
using LoggerPtr = std::shared_ptr<Logger>;

class IAST;
using ASTPtr = std::shared_ptr<IAST>;
using ASTs = std::vector<ASTPtr>;
using DBGInvokerPrinter = std::function<void(const std::string &)>;
extern void dbgFuncGcSchemas(Context &, const ASTs &, DBGInvokerPrinter);

Expand Down

0 comments on commit 5a79dc9

Please sign in to comment.