taco-db  0.1.0
TableInsertState.h
Go to the documentation of this file.
1 #ifndef EXECUTION_TABLEINSERTSTATE_H
2 #define EXECUTION_TABLEINSERTSTATE_H
3 
5 #include "plan/TableInsert.h"
6 #include "index/Index.h"
7 
8 namespace taco {
9 
26 public:
27  ~TableInsertState() override;
28 
29  void node_properties_to_string(std::string& buf, int indent) const override;
30 
31  void init() override;
32 
33  bool next_tuple() override;
34 
35  std::vector<NullableDatumRef> get_record() override;
36 
37  void close() override;
38 
39  void rewind() override;
40 
41  const PlanNode*
42  get_plan() const {
43  return m_plan;
44  }
45 
46 private:
47  TableInsertState(const TableInsert* plan,
48  std::unique_ptr<Table>&& table,
49  std::vector<std::unique_ptr<Index>>&& idxs,
50  std::unique_ptr<PlanExecState>&& child);
51 
53 
54  std::unique_ptr<Table> m_table;
55  std::vector<std::unique_ptr<Index>> m_idxs;
56  int64_t m_res;
57 
58  friend class TableInsert;
59 };
60 
61 } // namespace taco
62 
63 #endif
taco::TableInsertState::node_properties_to_string
void node_properties_to_string(std::string &buf, int indent) const override
Definition: TableInsertState.cpp:23
taco::TableInsertState::m_table
std::unique_ptr< Table > m_table
Definition: TableInsertState.h:54
taco::TableInsertState
TableDeleteState is the execution state for table insertion action.
Definition: TableInsertState.h:25
Index.h
taco
Definition: datum.h:28
taco::TableInsertState::get_record
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: TableInsertState.cpp:54
taco::TableInsertState::get_plan
const PlanNode * get_plan() const
Returns the corresponding plan.
Definition: TableInsertState.h:42
taco::TableInsertState::m_idxs
std::vector< std::unique_ptr< Index > > m_idxs
Definition: TableInsertState.h:55
taco::TableInsertState::m_res
int64_t m_res
Definition: TableInsertState.h:56
taco::TableInsertState::init
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: TableInsertState.cpp:28
taco::TableInsertState::m_plan
const TableInsert * m_plan
Definition: TableInsertState.h:52
taco::PlanExecState
PlanExecState is an abstract interface for execution state of various query plan.
Definition: PlanExecState.h:19
taco::TableInsertState::~TableInsertState
~TableInsertState() override
Definition: TableInsertState.cpp:16
taco::TableInsertState::close
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: TableInsertState.cpp:59
TableInsert.h
taco::TableInsertState::next_tuple
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: TableInsertState.cpp:36
taco::TableInsert
TableInsert is the physical plan for insert actions on a table.
Definition: TableInsert.h:22
PlanExecState.h
taco::PlanNode
PlanNode is an abstract interface representing physical query plan that does not bound with any parti...
Definition: PlanNode.h:26
taco::TableInsertState::rewind
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: TableInsertState.cpp:66
taco::TableInsertState::TableInsertState
TableInsertState(const TableInsert *plan, std::unique_ptr< Table > &&table, std::vector< std::unique_ptr< Index >> &&idxs, std::unique_ptr< PlanExecState > &&child)
Definition: TableInsertState.cpp:6