MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
project_physical_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/07/01.
13//
14
15#pragma once
16
17#include "sql/operator/physical_operator.h"
18
24{
25public:
27 {}
28
29 virtual ~ProjectPhysicalOperator() = default;
30
31 void add_expressions(std::vector<std::unique_ptr<Expression>> &&expressions)
32 {
33
34 }
35 void add_projection(const Table *table, const FieldMeta *field);
36
37 PhysicalOperatorType type() const override
38 {
39 return PhysicalOperatorType::PROJECT;
40 }
41
42 RC open(Trx *trx) override;
43 RC next() override;
44 RC close() override;
45
46 int cell_num() const
47 {
48 return tuple_.cell_num();
49 }
50
51 Tuple *current_tuple() override;
52
53private:
54 ProjectTuple tuple_;
55};
字段元数据
Definition: field_meta.h:31
与LogicalOperator对应,物理算子描述执行计划将如何执行
Definition: physical_operator.h:57
选择/投影物理算子
Definition: project_physical_operator.h:24
从一行数据中,选择部分字段组成的元组,也就是投影操作
Definition: tuple.h:235
int cell_num() const override
获取元组中的Cell的个数
Definition: tuple.h:255
Definition: table.h:37
事务接口
Definition: trx.h:142
元组的抽象描述
Definition: tuple.h:84
PhysicalOperatorType
物理算子类型
Definition: physical_operator.h:39