taco-db  0.1.0
AggregationState.h
Go to the documentation of this file.
1 #ifndef EXECUTION_AGGREGATION_H
2 #define EXECUTION_AGGREGATION_H
3 
5 #include "plan/Aggregation.h"
6 
7 namespace taco {
8 
18 public:
19  ~AggregationState() override;
20 
21  void node_properties_to_string(std::string& buf, int indent) const override;
22 
23  void init() override;
24 
25  bool next_tuple() override;
26 
27  std::vector<NullableDatumRef> get_record() override;
28 
29  void close() override;
30 
31  void rewind() override;
32 
33  Datum save_position() const override;
34 
35  bool rewind(DatumRef saved_position) override;
36 
37  const PlanNode*
38  get_plan() const override {
39  return m_plan;
40  }
41 
42 private:
43  AggregationState(const Aggregation* scan,
44  std::unique_ptr<PlanExecState>&& child);
45 
47 
48  // You can add your own states here.
49 
50  friend class Aggregation;
51 };
52 
53 } // namespace taco
54 
55 #endif
AggregationState is the execution state for aggregation.
Definition: AggregationState.h:17
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: AggregationState.cpp:42
AggregationState(const Aggregation *scan, std::unique_ptr< PlanExecState > &&child)
Definition: AggregationState.cpp:6
const PlanNode * get_plan() const override
Returns the corresponding plan.
Definition: AggregationState.h:38
Datum save_position() const override
Returns a saved position where this plan execution state is at.
Definition: AggregationState.cpp:52
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: AggregationState.cpp:25
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: AggregationState.cpp:36
const Aggregation * m_plan
Definition: AggregationState.h:46
~AggregationState() override
Definition: AggregationState.cpp:15
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: AggregationState.cpp:30
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: AggregationState.cpp:47
void node_properties_to_string(std::string &buf, int indent) const override
Definition: AggregationState.cpp:20
Aggregation is the physical plan for aggregations.
Definition: Aggregation.h:35
A DatumRef object is a read-only reference to an C++ object of a supported runtime type.
Definition: datum.h:823
A Datum stores and possibly manage the memory resource of a read-only value of a plain fixed-length C...
Definition: datum.h:250
PlanExecState is an abstract interface for execution state of various query plan.
Definition: PlanExecState.h:19
PlanNode is an abstract interface representing physical query plan that does not bound with any parti...
Definition: PlanNode.h:26
Definition: datum.h:28