OmniSciDB  c0231cc57d
 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 (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 2224 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 2226 of file RelAlgDag.h.

Constructor & Destructor Documentation

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

Definition at line 2228 of file RelAlgDag.h.

Referenced by toHash().

2230  : tuple_type_(tuple_type), values_(std::move(values)) {}
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285

+ Here is the caller graph for this function:

RelLogicalValues::RelLogicalValues ( RelLogicalValues const &  rhs)

Definition at line 572 of file RelAlgDag.cpp.

573  : RelAlgNode(rhs)
574  , tuple_type_(rhs.tuple_type_)
575  , values_(RexDeepCopyVisitor::copy(rhs.values_)) {}
RelAlgNode(RelAlgInputs inputs={})
Definition: RelAlgDag.h:774
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285
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 2279 of file RelAlgDag.h.

2279  {
2280  return std::make_shared<RelLogicalValues>(*this);
2281  }
size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2273 of file RelAlgDag.h.

References values_.

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

2273 { return values_.size(); }
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 2265 of file RelAlgDag.h.

References values_.

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

2265  {
2266  if (values_.empty()) {
2267  return 0;
2268  } else {
2269  return values_.front().size();
2270  }
2271  }
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285

+ Here is the caller graph for this function:

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

Definition at line 2234 of file RelAlgDag.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2234 { return tuple_type_; }
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284

+ 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 2258 of file RelAlgDag.h.

References CHECK_LT, and values_.

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

2258  {
2259  CHECK_LT(row_idx, values_.size());
2260  const auto& row = values_[row_idx];
2261  CHECK_LT(col_idx, row.size());
2262  return row[col_idx].get();
2263  }
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285
#define CHECK_LT(x, y)
Definition: Logger.h:232

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 2277 of file RelAlgDag.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

2277 { return !values_.empty(); }
const std::vector< RowValues > values_
Definition: RelAlgDag.h:2285

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2275 of file RelAlgDag.h.

References tuple_type_.

Referenced by ResultSetLogicalValuesBuilder::build().

2275 { return tuple_type_.size(); }
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284

+ Here is the caller graph for this function:

size_t RelLogicalValues::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2247 of file RelAlgDag.h.

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

2247  {
2248  if (!hash_) {
2249  hash_ = typeid(RelLogicalValues).hash_code();
2250  for (auto& target_meta_info : tuple_type_) {
2251  boost::hash_combine(*hash_, target_meta_info.get_resname());
2252  boost::hash_combine(*hash_, target_meta_info.get_type_info().get_type_name());
2253  }
2254  }
2255  return *hash_;
2256  }
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284
std::optional< size_t > hash_
Definition: RelAlgDag.h:889
RelLogicalValues(const std::vector< TargetMetaInfo > &tuple_type, std::vector< RowValues > &values)
Definition: RelAlgDag.h:2228

+ Here is the call graph for this function:

std::string RelLogicalValues::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2236 of file RelAlgDag.h.

References tuple_type_, and typeName().

2237  {
2238  std::string ret = ::typeName(this) + "(";
2239  for (const auto& target_meta_info : tuple_type_) {
2240  ret += " (" + target_meta_info.get_resname() + " " +
2241  target_meta_info.get_type_info().get_type_name() + ")";
2242  }
2243  ret += ")";
2244  return ret;
2245  }
const std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2284
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 2284 of file RelAlgDag.h.

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

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

Definition at line 2285 of file RelAlgDag.h.

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


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