MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
table_scan_vec_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#pragma once
12
13#include "common/sys/rc.h"
14#include "sql/operator/physical_operator.h"
15#include "storage/record/record_manager.h"
16#include "common/types.h"
17
18class Table;
19
25{
26public:
27 TableScanVecPhysicalOperator(Table *table, ReadWriteMode mode) : table_(table), mode_(mode) {}
28
29 virtual ~TableScanVecPhysicalOperator() = default;
30
31 string param() const override;
32
33 PhysicalOperatorType type() const override { return PhysicalOperatorType::TABLE_SCAN_VEC; }
34
35 RC open(Trx *trx) override;
36 RC next(Chunk &chunk) override;
37 RC close() override;
38
39 void set_predicates(vector<unique_ptr<Expression>> &&exprs);
40
41private:
42 RC filter(Chunk &chunk);
43
44private:
45 Table *table_ = nullptr;
46 ReadWriteMode mode_ = ReadWriteMode::READ_WRITE;
47 ChunkFileScanner chunk_scanner_;
48 Chunk all_columns_;
49 Chunk filterd_columns_;
50 vector<uint8_t> select_;
51 vector<unique_ptr<Expression>> predicates_;
52};
遍历某个文件中所有记录,每次返回一个 Chunk
Definition: record_manager.h:425
A Chunk represents a set of columns.
Definition: chunk.h:23
与LogicalOperator对应,物理算子描述执行计划将如何执行
Definition: physical_operator.h:63
表扫描物理算子(vectorized)
Definition: table_scan_vec_physical_operator.h:25
Definition: table.h:42
事务接口
Definition: trx.h:141
PhysicalOperatorType
物理算子类型
Definition: physical_operator.h:36