OmniSciDB  085a039ca4
 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 (RelRexToStringConfig config=RelRexToStringConfig::defaults()) 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
 
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
 
void setIdInPlanTree (size_t id) const
 
std::optional< size_t > getIdInPlanTree () 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 > id_in_plan_tree_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 2160 of file RelAlgDagBuilder.h.

Member Typedef Documentation

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

Definition at line 2162 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 2164 of file RelAlgDagBuilder.h.

Referenced by toHash().

2166  : 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 573 of file RelAlgDagBuilder.cpp.

574  : RelAlgNode(rhs)
575  , tuple_type_(rhs.tuple_type_)
576  , 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:210

Member Function Documentation

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

Implements RelAlgNode.

Definition at line 2215 of file RelAlgDagBuilder.h.

2215  {
2216  return std::make_shared<RelLogicalValues>(*this);
2217  }
size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2209 of file RelAlgDagBuilder.h.

References values_.

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

2209 { 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 2201 of file RelAlgDagBuilder.h.

References values_.

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

2201  {
2202  if (values_.empty()) {
2203  return 0;
2204  } else {
2205  return values_.front().size();
2206  }
2207  }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

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

Definition at line 2170 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2170 { 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 2194 of file RelAlgDagBuilder.h.

References CHECK_LT, and values_.

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

2194  {
2195  CHECK_LT(row_idx, values_.size());
2196  const auto& row = values_[row_idx];
2197  CHECK_LT(col_idx, row.size());
2198  return row[col_idx].get();
2199  }
const std::vector< RowValues > values_
#define CHECK_LT(x, y)
Definition: Logger.h:233

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 2213 of file RelAlgDagBuilder.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

2213 { 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 2211 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by ResultSetLogicalValuesBuilder::build().

2211 { 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 2183 of file RelAlgDagBuilder.h.

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

2183  {
2184  if (!hash_) {
2185  hash_ = typeid(RelLogicalValues).hash_code();
2186  for (auto& target_meta_info : tuple_type_) {
2187  boost::hash_combine(*hash_, target_meta_info.get_resname());
2188  boost::hash_combine(*hash_, target_meta_info.get_type_info().get_type_name());
2189  }
2190  }
2191  return *hash_;
2192  }
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 ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2172 of file RelAlgDagBuilder.h.

References tuple_type_, and typeName().

2173  {
2174  std::string ret = ::typeName(this) + "(";
2175  for (const auto& target_meta_info : tuple_type_) {
2176  ret += " (" + target_meta_info.get_resname() + " " +
2177  target_meta_info.get_type_info().get_type_name() + ")";
2178  }
2179  ret += ")";
2180  return ret;
2181  }
const std::vector< TargetMetaInfo > tuple_type_
std::string typeName(const T *v)
Definition: toString.h:102

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 2220 of file RelAlgDagBuilder.h.

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

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

Definition at line 2221 of file RelAlgDagBuilder.h.

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


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