MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
table_get_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#pragma once
15
16#include "sql/operator/logical_operator.h"
17#include "storage/field/field.h"
18
25{
26public:
27 TableGetLogicalOperator(Table *table, const std::vector<Field> &fields, bool readonly);
28 virtual ~TableGetLogicalOperator() = default;
29
30 LogicalOperatorType type() const override
31 {
32 return LogicalOperatorType::TABLE_GET;
33 }
34
35 Table *table() const { return table_; }
36 bool readonly() const { return readonly_; }
37
38 void set_predicates(std::vector<std::unique_ptr<Expression>> &&exprs);
39 std::vector<std::unique_ptr<Expression>> &predicates()
40 {
41 return predicates_;
42 }
43
44private:
45 Table *table_ = nullptr;
46 std::vector<Field> fields_;
47 bool readonly_ = false;
48
49 // 与当前表相关的过滤操作,可以尝试在遍历数据时执行
50 // 这里的表达式都是比较简单的比较运算,并且左右两边都是取字段表达式或值表达式
51 // 不包含复杂的表达式运算,比如加减乘除、或者conjunction expression
52 // 如果有多个表达式,他们的关系都是 AND
53 std::vector<std::unique_ptr<Expression>> predicates_;
54};
逻辑算子描述当前执行计划要做什么
Definition: logical_operator.h:50
表示从表中获取数据的算子
Definition: table_get_logical_operator.h:25
Definition: table.h:37