taco-db  0.1.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
taco::Projection Class Reference

Projection is the physical plan for projections. More...

#include <plan/Projection.h>

Inheritance diagram for taco::Projection:
taco::PlanNode taco::TreeNode

Public Member Functions

 ~Projection () override
 
void node_properties_to_string (std::string &buf, int indent) const override
 
std::unique_ptr< PlanExecStatecreate_exec_state () const override
 Create the corresponding execution state for the physical plan so that it can be used as physical scan operator later. More...
 
const Schemaget_output_schema () const override
 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::PlanNode
template<class ... UniquePtrs>
 PlanNode (NodeTag tag, UniquePtrs &&...input)
 Base constructor for all physical plan node. More...
 
virtual ~PlanNode ()
 Deconstructor of PlanExecState. More...
 
- Public Member Functions inherited from taco::TreeNode
template<class ... UniquePtrs>
 TreeNode (NodeTag tag, UniquePtrs &&...input)
 
virtual ~TreeNode ()
 
 TreeNode (TreeNode &&)=default
 
TreeNodeoperator= (TreeNode &&)=default
 
 TreeNode (const TreeNode &)=delete
 
TreeNodeoperator= (const TreeNode &)=delete
 
constexpr NodeTag get_tag () const
 
TreeNodeget_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
 

Static Public Member Functions

static std::unique_ptr< ProjectionCreate (std::unique_ptr< PlanNode > &&child, std::vector< std::unique_ptr< ExprNode >> &&exprs)
 
- Static Public Member Functions inherited from taco::TreeNode
static void append_indent (std::string &buf, int indent)
 

Private Member Functions

 Projection (std::unique_ptr< PlanNode > &&child, std::vector< std::unique_ptr< ExprNode >> &&exprs)
 

Private Attributes

std::vector< std::unique_ptr< ExprNode > > m_exprs
 
std::unique_ptr< Schemam_schema
 

Friends

class ProjectionState
 

Additional Inherited Members

- Protected Member Functions inherited from taco::PlanNode
PlanNodeget_child (size_t i) const
 Utility function to get the raw pointer of i-th child of this physical plan. More...
 

Detailed Description

Projection is the physical plan for projections.

This physical plan should remember its child plan and a list of expressions conducted on input columns of its child. It should also derive the correct output schema based on the provided expressions through assembling their return types.

Constructor & Destructor Documentation

◆ ~Projection()

taco::Projection::~Projection ( )
override

◆ Projection()

taco::Projection::Projection ( std::unique_ptr< PlanNode > &&  child,
std::vector< std::unique_ptr< ExprNode >> &&  exprs 
)
private

Member Function Documentation

◆ Create()

std::unique_ptr< Projection > taco::Projection::Create ( std::unique_ptr< PlanNode > &&  child,
std::vector< std::unique_ptr< ExprNode >> &&  exprs 
)
static

◆ create_exec_state()

std::unique_ptr< PlanExecState > taco::Projection::create_exec_state ( ) const
overridevirtual

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.

Implements taco::PlanNode.

◆ get_output_schema()

const Schema * taco::Projection::get_output_schema ( ) const
overridevirtual

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.

Implements taco::PlanNode.

◆ node_properties_to_string()

void taco::Projection::node_properties_to_string ( std::string &  buf,
int  indent 
) const
overridevirtual

Implements taco::TreeNode.

Friends And Related Function Documentation

◆ ProjectionState

friend class ProjectionState
friend

Member Data Documentation

◆ m_exprs

std::vector<std::unique_ptr<ExprNode> > taco::Projection::m_exprs
private

◆ m_schema

std::unique_ptr<Schema> taco::Projection::m_schema
private

The documentation for this class was generated from the following files: