MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
全部  文件 函数 变量 枚举 枚举值 宏定义  
logical_operator.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2022/12/07.
13//
14
15#pragma once
16
17#include <memory>
18#include <vector>
19
20#include "sql/expr/expression.h"
21
33enum class LogicalOperatorType
34{
35 CALC,
36 TABLE_GET,
37 PREDICATE,
38 PROJECTION,
39 JOIN,
40 INSERT,
41 DELETE,
42 EXPLAIN,
43};
44
50{
51public:
52 LogicalOperator() = default;
53 virtual ~LogicalOperator();
54
55 virtual LogicalOperatorType type() const = 0;
56
57 void add_child(std::unique_ptr<LogicalOperator> oper);
58 std::vector<std::unique_ptr<LogicalOperator>> &children()
59 {
60 return children_;
61 }
62 std::vector<std::unique_ptr<Expression>> &expressions()
63 {
64 return expressions_;
65 }
66
67protected:
68 std::vector<std::unique_ptr<LogicalOperator>> children_;
69
72 std::vector<std::unique_ptr<Expression>> expressions_;
73};
逻辑算子描述当前执行计划要做什么
Definition: logical_operator.h:50
std::vector< std::unique_ptr< LogicalOperator > > children_
子算子
Definition: logical_operator.h:68