OmniSciDB  8a228a1076
RelLogicalValues Class Reference

#include <RelAlgDagBuilder.h>

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

Public Types

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

Public Member Functions

 RelLogicalValues (const std::vector< TargetMetaInfo > &tuple_type, std::vector< RowValues > &values)
 
 RelLogicalValues (RelLogicalValues const &)
 
const std::vector< TargetMetaInfogetTupleType () const
 
std::string toString () const override
 
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
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const void *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
const std::vector< TargetMetaInfo > & getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const void * getContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) 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)
 
bool isNop () const
 
void markAsNop ()
 

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 1729 of file RelAlgDagBuilder.h.

Member Typedef Documentation

◆ RowValues

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

Definition at line 1731 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

◆ RelLogicalValues() [1/2]

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

Definition at line 1733 of file RelAlgDagBuilder.h.

1735  : tuple_type_(tuple_type), values_(std::move(values)) {}
const std::vector< TargetMetaInfo > tuple_type_
const std::vector< RowValues > values_

◆ RelLogicalValues() [2/2]

RelLogicalValues::RelLogicalValues ( RelLogicalValues const &  rhs)

Definition at line 354 of file RelAlgDagBuilder.cpp.

355  : RelAlgNode(rhs)
356  , tuple_type_(rhs.tuple_type_)
357  , values_(RexDeepCopyVisitor::copy(rhs.values_)) {}
RelAlgNode(RelAlgInputs inputs={})
const std::vector< TargetMetaInfo > tuple_type_
const std::vector< RowValues > values_
static std::vector< RowValues > copy(std::vector< RowValues > const &rhs)
Definition: RexVisitor.h:209

Member Function Documentation

◆ deepCopy()

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

Implements RelAlgNode.

Definition at line 1773 of file RelAlgDagBuilder.h.

1773  {
1774  return std::make_shared<RelLogicalValues>(*this);
1775  }

◆ getNumRows()

size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 1767 of file RelAlgDagBuilder.h.

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

1767 { return values_.size(); }
const std::vector< RowValues > values_
+ Here is the caller graph for this function:

◆ getRowsSize()

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 1759 of file RelAlgDagBuilder.h.

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

1759  {
1760  if (values_.empty()) {
1761  return 0;
1762  } else {
1763  return values_.front().size();
1764  }
1765  }
const std::vector< RowValues > values_
+ Here is the caller graph for this function:

◆ getTupleType()

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

Definition at line 1739 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1739 { return tuple_type_; }
const std::vector< TargetMetaInfo > tuple_type_
+ Here is the caller graph for this function:

◆ getValueAt()

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

Definition at line 1752 of file RelAlgDagBuilder.h.

References CHECK_LT.

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

1752  {
1753  CHECK_LT(row_idx, values_.size());
1754  const auto& row = values_[row_idx];
1755  CHECK_LT(col_idx, row.size());
1756  return row[col_idx].get();
1757  }
const std::vector< RowValues > values_
#define CHECK_LT(x, y)
Definition: Logger.h:207
+ Here is the caller graph for this function:

◆ hasRows()

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 1771 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1771 { return !values_.empty(); }
const std::vector< RowValues > values_
+ Here is the caller graph for this function:

◆ size()

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1769 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1769 { return tuple_type_.size(); }
const std::vector< TargetMetaInfo > tuple_type_
+ Here is the caller graph for this function:

◆ toString()

std::string RelLogicalValues::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1741 of file RelAlgDagBuilder.h.

References to_string().

1741  {
1742  std::string ret =
1743  "(RelLogicalValues<" + std::to_string(reinterpret_cast<uint64_t>(this)) + ">";
1744  for (const auto& target_meta_info : tuple_type_) {
1745  ret += " (" + target_meta_info.get_resname() + " " +
1746  target_meta_info.get_type_info().get_type_name() + ")";
1747  }
1748  ret += " )";
1749  return ret;
1750  }
const std::vector< TargetMetaInfo > tuple_type_
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

Member Data Documentation

◆ tuple_type_

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

Definition at line 1778 of file RelAlgDagBuilder.h.

◆ values_

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

Definition at line 1779 of file RelAlgDagBuilder.h.


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