taco-db
0.1.0
|
PlanNode
is an abstract interface representing physical query plan that does not bound with any particular execution state.
More...
#include <plan/PlanNode.h>
Public Member Functions | |
template<class ... UniquePtrs> | |
PlanNode (NodeTag tag, UniquePtrs &&...input) | |
Base constructor for all physical plan node. More... | |
virtual | ~PlanNode () |
Deconstructor of PlanExecState. More... | |
virtual std::unique_ptr< PlanExecState > | create_exec_state () const =0 |
Create the corresponding execution state for the physical plan so that it can be used as physical scan operator later. More... | |
virtual const Schema * | get_output_schema () const =0 |
Each physical plan should link a schema for its output relation, incidating what fields are included in its output records. More... | |
Public Member Functions inherited from taco::TreeNode | |
template<class ... UniquePtrs> | |
TreeNode (NodeTag tag, UniquePtrs &&...input) | |
virtual | ~TreeNode () |
TreeNode (TreeNode &&)=default | |
TreeNode & | operator= (TreeNode &&)=default |
TreeNode (const TreeNode &)=delete | |
TreeNode & | operator= (const TreeNode &)=delete |
constexpr NodeTag | get_tag () const |
TreeNode * | get_input (size_t i) const |
template<class Node > | |
Node * | get_input_as (size_t i) const |
std::string | to_string () const |
void | node_to_string (std::string &buf, int indent) const |
Prints the node contents to a string buffer. More... | |
const char * | node_name () const |
virtual void | node_properties_to_string (std::string &buf, int indent) const =0 |
Protected Member Functions | |
PlanNode * | get_child (size_t i) const |
Utility function to get the raw pointer of i-th child of this physical plan. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from taco::TreeNode | |
static void | append_indent (std::string &buf, int indent) |
PlanNode
is an abstract interface representing physical query plan that does not bound with any particular execution state.
More than one PlanExecState
can be generated from the same physical plan, allowing multiple users executing the same plan at different stage concurrently. An instance of PlanNode
should contain all information related to the plan itself (e.g. selection condition, projection attributes, etc) but not how far the users have retrieve its output record.
|
inline |
Base constructor for all physical plan node.
It is marked with a node tag (see include/utils/tree/node_Tags.inc for more details) and unique pointers to all of its children execution states. The unique pointers to its children will be moved to TreeNode
internal states after the construction so you don't have to remember it separately.
Note: You can use TAG(ClassName)
to get the corresponding tag for a plan execution state. For example, TAG(Selection)
will give you the tag of Selection
.
|
inlinevirtual |
Deconstructor of PlanExecState.
|
pure virtual |
Create the corresponding execution state for the physical plan so that it can be used as physical scan operator later.
This should create an execution state matching the current physical plan, all its descendant execution states, and link them together.
Implemented in taco::TempTable, taco::TableScan, taco::TableInsert, taco::TableDelete, taco::Sort, taco::Selection, taco::Projection, taco::Limit, taco::IndexScan, taco::CartesianProduct, and taco::Aggregation.
|
inlineprotected |
Utility function to get the raw pointer of i-th
child of this physical plan.
|
pure virtual |
Each physical plan should link a schema for its output relation, incidating what fields are included in its output records.
This function returns the output schema of this physical plan.
NOTE: if you want to create a schema owned by the plan, you should make sure ComputeLayout()
is called upon the newly created plan so that it can be used in serialize/deserialize records.
Implemented in taco::TempTable, taco::TableScan, taco::TableInsert, taco::TableDelete, taco::Sort, taco::Selection, taco::Projection, taco::Limit, taco::IndexScan, taco::CartesianProduct, and taco::Aggregation.