OmniSciDB  c1a53651b2
 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 &)
 
const std::vector< TargetMetaInfogetTupleType () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () 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
 
- 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
 
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

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

Friends

struct RelAlgDagSerializer
 

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

Detailed Description

Definition at line 2387 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 2389 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelLogicalValues::RelLogicalValues ( )
default

Referenced by toHash().

+ Here is the caller graph for this function:

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

Definition at line 2394 of file RelAlgDag.h.

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

Definition at line 573 of file RelAlgDag.cpp.

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

Member Function Documentation

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

Implements RelAlgNode.

Definition at line 2450 of file RelAlgDag.h.

2450  {
2451  return std::make_shared<RelLogicalValues>(*this);
2452  }
std::string RelLogicalValues::getFieldName ( const size_t  col_idx) const
inline

Definition at line 2424 of file RelAlgDag.h.

References CHECK_LT, size(), and tuple_type_.

2424  {
2425  CHECK_LT(col_idx, size());
2426  return tuple_type_[col_idx].get_resname();
2427  }
size_t size() const override
Definition: RelAlgDag.h:2446
#define CHECK_LT(x, y)
Definition: Logger.h:303
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2455

+ Here is the call graph for this function:

size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2444 of file RelAlgDag.h.

References values_.

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

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 2436 of file RelAlgDag.h.

References values_.

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

2436  {
2437  if (values_.empty()) {
2438  return 0;
2439  } else {
2440  return values_.front().size();
2441  }
2442  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2456

+ Here is the caller graph for this function:

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

Definition at line 2400 of file RelAlgDag.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2400 { return tuple_type_; }
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2455

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

References CHECK_LT, and values_.

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

2429  {
2430  CHECK_LT(row_idx, values_.size());
2431  const auto& row = values_[row_idx];
2432  CHECK_LT(col_idx, row.size());
2433  return row[col_idx].get();
2434  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2456
#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 2448 of file RelAlgDag.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2446 of file RelAlgDag.h.

References tuple_type_.

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

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2413 of file RelAlgDag.h.

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

2413  {
2414  if (!hash_) {
2415  hash_ = typeid(RelLogicalValues).hash_code();
2416  for (auto& target_meta_info : tuple_type_) {
2417  boost::hash_combine(*hash_, target_meta_info.get_resname());
2418  boost::hash_combine(*hash_, target_meta_info.get_type_info().get_type_name());
2419  }
2420  }
2421  return *hash_;
2422  }
RelLogicalValues()=default
std::optional< size_t > hash_
Definition: RelAlgDag.h:955
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2455

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 2402 of file RelAlgDag.h.

References tuple_type_, and typeName().

2403  {
2404  std::string ret = ::typeName(this) + "(";
2405  for (const auto& target_meta_info : tuple_type_) {
2406  ret += " (" + target_meta_info.get_resname() + " " +
2407  target_meta_info.get_type_info().get_type_name() + ")";
2408  }
2409  ret += ")";
2410  return ret;
2411  }
std::string typeName(const T *v)
Definition: toString.h:103
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2455

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 2458 of file RelAlgDag.h.

Member Data Documentation

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

Definition at line 2455 of file RelAlgDag.h.

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

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

Definition at line 2456 of file RelAlgDag.h.

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


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