OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelLogicalValues Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RelLogicalValues:
+ Collaboration diagram for RelLogicalValues:

Public Types

using RowValues = std::vector< std::unique_ptr< const RexScalar >>
 

Public Member Functions

 RelLogicalValues ()=default
 
 RelLogicalValues (const std::vector< TargetMetaInfo > &tuple_type, std::vector< RowValues > &values)
 
 RelLogicalValues (RelLogicalValues const &)
 
virtual void acceptChildren (Visitor &v) const override
 
virtual void accept (Visitor &v, std::string name) const override
 
const std::vector< TargetMetaInfogetTupleType () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
std::string getFieldName (const size_t col_idx) const
 
const RexScalargetValueAt (const size_t row_idx, const size_t col_idx) const
 
size_t getRowsSize () const
 
size_t getNumRows () const
 
size_t size () const override
 
bool hasRows () const
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
virtual size_t toHash () const override
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const RaExecutionDesc *context_data) const
 
void setOutputMetainfo (std::vector< TargetMetaInfo > targets_metainfo) const
 
void setQueryPlanDag (const std::string &extracted_query_plan_dag) const
 
std::string getQueryPlanDag () const
 
size_t getQueryPlanDagHash () const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const RaExecutionDescgetContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) const
 
const std::vector< RelAlgNode
const * > 
getInputs () const
 
std::shared_ptr< const RelAlgNodegetAndOwnInput (const size_t idx) const
 
void addManagedInput (std::shared_ptr< const RelAlgNode > input)
 
bool hasInput (const RelAlgNode *needle) const
 
virtual void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 
- Public Member Functions inherited from RelAlgDagNode
 RelAlgDagNode ()
 
virtual size_t getStepNumber () const
 
virtual void setStepNumber (size_t step) const
 
std::optional< size_t > getIdInPlanTree () const
 
void setIdInPlanTree (size_t id) const
 

Private Attributes

std::vector< TargetMetaInfotuple_type_
 
std::vector< RowValuesvalues_
 

Friends

struct RelAlgDagSerializer
 
std::size_t hash_value (RelLogicalValues const &)
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
unsigned id_
 
std::optional< size_t > hash_
 
- Protected Attributes inherited from RelAlgDagNode
size_t step_ {0}
 
std::optional< size_t > id_in_plan_tree_
 

Detailed Description

Definition at line 2654 of file RelAlgDag.h.

Member Typedef Documentation

using RelLogicalValues::RowValues = std::vector<std::unique_ptr<const RexScalar>>

Definition at line 2656 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelLogicalValues::RelLogicalValues ( )
default
RelLogicalValues::RelLogicalValues ( const std::vector< TargetMetaInfo > &  tuple_type,
std::vector< RowValues > &  values 
)
inline

Definition at line 2661 of file RelAlgDag.h.

2663  : tuple_type_(tuple_type), values_(std::move(values)) {}
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735
RelLogicalValues::RelLogicalValues ( RelLogicalValues const &  rhs)

Definition at line 574 of file RelAlgDag.cpp.

575  : RelAlgNode(rhs)
576  , tuple_type_(rhs.tuple_type_)
577  , values_(RexDeepCopyVisitor::copy(rhs.values_)) {}
RelAlgNode(RelAlgInputs inputs={})
Definition: RelAlgDag.h:830
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736
static std::vector< RowValues > copy(std::vector< RowValues > const &rhs)
Definition: RexVisitor.h:210
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735

Member Function Documentation

virtual void RelLogicalValues::accept ( Visitor v,
std::string  name 
) const
inlineoverridevirtual

Implements RelAlgDagNode.

Definition at line 2681 of file RelAlgDag.h.

References acceptChildren(), and RelAlgDagNode::Visitor::visit().

Referenced by TableFunctionsFactory_node.PrintNode::__str__().

2681  {
2682  if (v.visit(this, std::move(name))) {
2683  acceptChildren(v);
2684  }
2685  }
virtual void acceptChildren(Visitor &v) const override
Definition: RelAlgDag.h:2667
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void RelLogicalValues::acceptChildren ( Visitor v) const
inlineoverridevirtual

Implements RelAlgDagNode.

Definition at line 2667 of file RelAlgDag.h.

References RelAlgDagNode::accept(), RelAlgNode::getInputs(), getNumRows(), getRowsSize(), getValueAt(), and anonymous_namespace{Utm.h}::n.

Referenced by accept().

2667  {
2668  for (size_t row_idx = 0; row_idx < getNumRows(); ++row_idx) {
2669  for (size_t col_idx = 0; col_idx < getRowsSize(); ++col_idx) {
2670  if (getValueAt(row_idx, col_idx)) {
2671  getValueAt(row_idx, col_idx)->accept(v, "value");
2672  }
2673  }
2674  }
2675  for (auto& n : getInputs()) {
2676  if (n) {
2677  n->accept(v, "input");
2678  }
2679  }
2680  }
size_t getNumRows() const
Definition: RelAlgDag.h:2720
size_t getRowsSize() const
Definition: RelAlgDag.h:2712
virtual void accept(Visitor &v, std::string name) const =0
const std::vector< RelAlgNode const * > getInputs() const
Definition: RelAlgDag.h:882
const RexScalar * getValueAt(const size_t row_idx, const size_t col_idx) const
Definition: RelAlgDag.h:2705
constexpr double n
Definition: Utm.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<RelAlgNode> RelLogicalValues::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2726 of file RelAlgDag.h.

2726  {
2727  return std::make_shared<RelLogicalValues>(*this);
2728  }
std::string RelLogicalValues::getFieldName ( const size_t  col_idx) const
inline

Definition at line 2700 of file RelAlgDag.h.

References CHECK_LT, size(), and tuple_type_.

2700  {
2701  CHECK_LT(col_idx, size());
2702  return tuple_type_[col_idx].get_resname();
2703  }
size_t size() const override
Definition: RelAlgDag.h:2722
#define CHECK_LT(x, y)
Definition: Logger.h:303
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735

+ Here is the call graph for this function:

size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2720 of file RelAlgDag.h.

References values_.

Referenced by acceptChildren(), ResultSetLogicalValuesBuilder::build(), RelAlgExecutor::executeLogicalValues(), and RelRexDagVisitor::visit().

2720 { return values_.size(); }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 2712 of file RelAlgDag.h.

References values_.

Referenced by acceptChildren(), ResultSetLogicalValuesBuilder::build(), and RelRexDagVisitor::visit().

2712  {
2713  if (values_.empty()) {
2714  return 0;
2715  } else {
2716  return values_.front().size();
2717  }
2718  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736

+ Here is the caller graph for this function:

const std::vector<TargetMetaInfo> RelLogicalValues::getTupleType ( ) const
inline

Definition at line 2687 of file RelAlgDag.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2687 { return tuple_type_; }
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735

+ Here is the caller graph for this function:

const RexScalar* RelLogicalValues::getValueAt ( const size_t  row_idx,
const size_t  col_idx 
) const
inline

Definition at line 2705 of file RelAlgDag.h.

References CHECK_LT, and values_.

Referenced by acceptChildren(), ResultSetLogicalValuesBuilder::build(), and RelRexDagVisitor::visit().

2705  {
2706  CHECK_LT(row_idx, values_.size());
2707  const auto& row = values_[row_idx];
2708  CHECK_LT(col_idx, row.size());
2709  return row[col_idx].get();
2710  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736
#define CHECK_LT(x, y)
Definition: Logger.h:303

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 2724 of file RelAlgDag.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

2724 { return !values_.empty(); }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2736

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2722 of file RelAlgDag.h.

References tuple_type_.

Referenced by ResultSetLogicalValuesBuilder::build(), and getFieldName().

2722 { return tuple_type_.size(); }
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735

+ Here is the caller graph for this function:

virtual size_t RelLogicalValues::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2730 of file RelAlgDag.h.

References hash_value.

2730 { return hash_value(*this); }
friend std::size_t hash_value(RelLogicalValues const &)
Definition: RelAlgDag.cpp:3832
std::string RelLogicalValues::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2689 of file RelAlgDag.h.

References tuple_type_, and typeName().

2690  {
2691  std::string ret = ::typeName(this) + "(";
2692  for (const auto& target_meta_info : tuple_type_) {
2693  ret += "(" + target_meta_info.get_resname() + " " +
2694  target_meta_info.get_type_info().get_type_name() + ")";
2695  }
2696  ret += ")";
2697  return ret;
2698  }
std::string typeName(const T *v)
Definition: toString.h:106
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2735

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( RelLogicalValues const &  rel_lv)
friend

Definition at line 3832 of file RelAlgDag.cpp.

Referenced by toHash().

3832  {
3833  if (rel_lv.hash_) {
3834  return *rel_lv.hash_;
3835  }
3836  rel_lv.hash_ = typeid(RelLogicalValues).hash_code();
3837  for (auto& target_meta_info : rel_lv.tuple_type_) {
3838  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_resname());
3839  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_type_info().get_type_name());
3840  }
3841  return *rel_lv.hash_;
3842 }
RelLogicalValues()=default
friend struct RelAlgDagSerializer
friend

Definition at line 2738 of file RelAlgDag.h.

Member Data Documentation

std::vector<TargetMetaInfo> RelLogicalValues::tuple_type_
private

Definition at line 2735 of file RelAlgDag.h.

Referenced by getFieldName(), getTupleType(), hash_value(), size(), and toString().

std::vector<RowValues> RelLogicalValues::values_
private

Definition at line 2736 of file RelAlgDag.h.

Referenced by getNumRows(), getRowsSize(), getValueAt(), and hasRows().


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