OmniSciDB  a987f07e93
 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 2362 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 2364 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 2369 of file RelAlgDag.h.

2371  : tuple_type_(tuple_type), values_(std::move(values)) {}
std::vector< RowValues > values_
Definition: RelAlgDag.h:2431
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430
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:2431
static std::vector< RowValues > copy(std::vector< RowValues > const &rhs)
Definition: RexVisitor.h:210
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430

Member Function Documentation

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

Implements RelAlgNode.

Definition at line 2425 of file RelAlgDag.h.

2425  {
2426  return std::make_shared<RelLogicalValues>(*this);
2427  }
std::string RelLogicalValues::getFieldName ( const size_t  col_idx) const
inline

Definition at line 2399 of file RelAlgDag.h.

References CHECK_LT, size(), and tuple_type_.

2399  {
2400  CHECK_LT(col_idx, size());
2401  return tuple_type_[col_idx].get_resname();
2402  }
size_t size() const override
Definition: RelAlgDag.h:2421
#define CHECK_LT(x, y)
Definition: Logger.h:299
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430

+ Here is the call graph for this function:

size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 2419 of file RelAlgDag.h.

References values_.

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

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 2411 of file RelAlgDag.h.

References values_.

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

2411  {
2412  if (values_.empty()) {
2413  return 0;
2414  } else {
2415  return values_.front().size();
2416  }
2417  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2431

+ Here is the caller graph for this function:

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

Definition at line 2375 of file RelAlgDag.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

2375 { return tuple_type_; }
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430

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

References CHECK_LT, and values_.

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

2404  {
2405  CHECK_LT(row_idx, values_.size());
2406  const auto& row = values_[row_idx];
2407  CHECK_LT(col_idx, row.size());
2408  return row[col_idx].get();
2409  }
std::vector< RowValues > values_
Definition: RelAlgDag.h:2431
#define CHECK_LT(x, y)
Definition: Logger.h:299

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 2423 of file RelAlgDag.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2421 of file RelAlgDag.h.

References tuple_type_.

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

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

+ Here is the caller graph for this function:

size_t RelLogicalValues::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 2388 of file RelAlgDag.h.

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

2388  {
2389  if (!hash_) {
2390  hash_ = typeid(RelLogicalValues).hash_code();
2391  for (auto& target_meta_info : tuple_type_) {
2392  boost::hash_combine(*hash_, target_meta_info.get_resname());
2393  boost::hash_combine(*hash_, target_meta_info.get_type_info().get_type_name());
2394  }
2395  }
2396  return *hash_;
2397  }
RelLogicalValues()=default
std::optional< size_t > hash_
Definition: RelAlgDag.h:955
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 2377 of file RelAlgDag.h.

References tuple_type_, and typeName().

2378  {
2379  std::string ret = ::typeName(this) + "(";
2380  for (const auto& target_meta_info : tuple_type_) {
2381  ret += " (" + target_meta_info.get_resname() + " " +
2382  target_meta_info.get_type_info().get_type_name() + ")";
2383  }
2384  ret += ")";
2385  return ret;
2386  }
std::string typeName(const T *v)
Definition: toString.h:103
std::vector< TargetMetaInfo > tuple_type_
Definition: RelAlgDag.h:2430

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 2433 of file RelAlgDag.h.

Member Data Documentation

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

Definition at line 2430 of file RelAlgDag.h.

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

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

Definition at line 2431 of file RelAlgDag.h.

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


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