OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 
size_t toHash () 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 RaExecutionDesc *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 RaExecutionDescgetContextData () 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)
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 

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_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 2011 of file RelAlgDagBuilder.h.

Member Typedef Documentation

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

Definition at line 2013 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 2015 of file RelAlgDagBuilder.h.

Referenced by toHash().

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

+ Here is the caller graph for this function:

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

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

Implements RelAlgNode.

Definition at line 2065 of file RelAlgDagBuilder.h.

2065  {
2066  return std::make_shared<RelLogicalValues>(*this);
2067  }
size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2059 of file RelAlgDagBuilder.h.

References values_.

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

2059 { return values_.size(); }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 2051 of file RelAlgDagBuilder.h.

References values_.

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

2051  {
2052  if (values_.empty()) {
2053  return 0;
2054  } else {
2055  return values_.front().size();
2056  }
2057  }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

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

Definition at line 2021 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2021 { return tuple_type_; }
const std::vector< TargetMetaInfo > tuple_type_

+ 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 2044 of file RelAlgDagBuilder.h.

References CHECK_LT, and values_.

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

2044  {
2045  CHECK_LT(row_idx, values_.size());
2046  const auto& row = values_[row_idx];
2047  CHECK_LT(col_idx, row.size());
2048  return row[col_idx].get();
2049  }
const std::vector< RowValues > values_
#define CHECK_LT(x, y)
Definition: Logger.h:221

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 2063 of file RelAlgDagBuilder.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

2063 { return !values_.empty(); }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2061 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by ResultSetLogicalValuesBuilder::build().

2061 { return tuple_type_.size(); }
const std::vector< TargetMetaInfo > tuple_type_

+ Here is the caller graph for this function:

size_t RelLogicalValues::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2033 of file RelAlgDagBuilder.h.

References RelAlgNode::hash_, RelLogicalValues(), and tuple_type_.

2033  {
2034  if (!hash_) {
2035  hash_ = typeid(RelLogicalValues).hash_code();
2036  for (auto& target_meta_info : tuple_type_) {
2037  boost::hash_combine(*hash_, target_meta_info.get_resname());
2038  boost::hash_combine(*hash_, target_meta_info.get_type_info().get_type_name());
2039  }
2040  }
2041  return *hash_;
2042  }
const std::vector< TargetMetaInfo > tuple_type_
std::optional< size_t > hash_
RelLogicalValues(const std::vector< TargetMetaInfo > &tuple_type, std::vector< RowValues > &values)

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 2023 of file RelAlgDagBuilder.h.

References tuple_type_, and typeName().

2023  {
2024  std::string ret = ::typeName(this) + "(";
2025  for (const auto& target_meta_info : tuple_type_) {
2026  ret += " (" + target_meta_info.get_resname() + " " +
2027  target_meta_info.get_type_info().get_type_name() + ")";
2028  }
2029  ret += ")";
2030  return ret;
2031  }
const std::vector< TargetMetaInfo > tuple_type_
std::string typeName(const T *v)
Definition: toString.h:93

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 2070 of file RelAlgDagBuilder.h.

Referenced by getTupleType(), size(), toHash(), and toString().

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

Definition at line 2071 of file RelAlgDagBuilder.h.

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


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