OmniSciDB  cecceef8da
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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)
 
const std::vector< TargetMetaInfogetTupleType () const
 
std::string toString () 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 ()
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const void *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 void * getContextData () 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)
 
bool isNop () const
 
void markAsNop ()
 

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
std::vector< std::shared_ptr
< const RelAlgNode > > 
inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 1448 of file RelAlgDagBuilder.h.

Member Typedef Documentation

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

Definition at line 1450 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 1452 of file RelAlgDagBuilder.h.

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

Member Function Documentation

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

Implements RelAlgNode.

Definition at line 303 of file RelAlgDagBuilder.cpp.

References tuple_type_, values_, and RexVisitorBase< T >::visit().

303  {
304  RexDeepCopyVisitor copier;
305  std::vector<RelLogicalValues::RowValues> values_copy;
306  for (auto& row : values_) {
307  values_copy.emplace_back(RelLogicalValues::RowValues{});
308  for (auto& value : row) {
309  values_copy.back().push_back(copier.visit(value.get()));
310  }
311  }
312  return std::make_shared<RelLogicalValues>(tuple_type_, values_copy);
313 }
const std::vector< TargetMetaInfo > tuple_type_
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
const std::vector< RowValues > values_
std::vector< std::unique_ptr< const RexScalar >> RowValues

+ Here is the call graph for this function:

size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 1484 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1484 { 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 1476 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1476  {
1477  if (values_.empty()) {
1478  return 0;
1479  } else {
1480  return values_.front().size();
1481  }
1482  }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

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

Definition at line 1456 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1456 { 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 1469 of file RelAlgDagBuilder.h.

References CHECK_LT.

Referenced by RelAlgExecutor::executeLogicalValues().

1469  {
1470  CHECK_LT(row_idx, values_.size());
1471  const auto& row = values_[row_idx];
1472  CHECK_LT(col_idx, row.size());
1473  return row[col_idx].get();
1474  }
const std::vector< RowValues > values_
#define CHECK_LT(x, y)
Definition: Logger.h:207

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 1488 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

1488 { 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 1486 of file RelAlgDagBuilder.h.

Referenced by RelAlgExecutor::executeLogicalValues().

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

+ Here is the caller graph for this function:

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

Implements RelAlgNode.

Definition at line 1458 of file RelAlgDagBuilder.h.

References to_string().

1458  {
1459  std::string ret =
1460  "(RelLogicalValues<" + std::to_string(reinterpret_cast<uint64_t>(this)) + ">";
1461  for (const auto& target_meta_info : tuple_type_) {
1462  ret += " (" + target_meta_info.get_resname() + " " +
1463  target_meta_info.get_type_info().get_type_name() + ")";
1464  }
1465  ret += " )";
1466  return ret;
1467  }
const std::vector< TargetMetaInfo > tuple_type_
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 1493 of file RelAlgDagBuilder.h.

Referenced by deepCopy().

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

Definition at line 1494 of file RelAlgDagBuilder.h.

Referenced by deepCopy().


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