OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RexSubQuery Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RexSubQuery:
+ Collaboration diagram for RexSubQuery:

Public Types

using ExecutionResultShPtr = std::shared_ptr< const ExecutionResult >
 

Public Member Functions

 RexSubQuery ()
 
 RexSubQuery (const std::shared_ptr< const RelAlgNode > ra)
 
 RexSubQuery (std::shared_ptr< SQLTypeInfo > type, std::shared_ptr< ExecutionResultShPtr > result, const std::shared_ptr< const RelAlgNode > ra)
 
 RexSubQuery (const RexSubQuery &)=delete
 
RexSubQueryoperator= (const RexSubQuery &)=delete
 
 RexSubQuery (RexSubQuery &&)=delete
 
RexSubQueryoperator= (RexSubQuery &&)=delete
 
const SQLTypeInfogetType () const
 
ExecutionResultShPtr getExecutionResult () const
 
unsigned getId () const
 
const RelAlgNodegetRelAlg () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
std::unique_ptr< RexSubQuerydeepCopy () const
 
void setExecutionResult (const ExecutionResultShPtr result)
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Private Attributes

std::shared_ptr< SQLTypeInfotype_
 
std::shared_ptr
< ExecutionResultShPtr
result_
 
std::shared_ptr< const RelAlgNodera_
 

Friends

struct RelAlgDagSerializer
 

Additional Inherited Members

- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 

Detailed Description

Definition at line 320 of file RelAlgDag.h.

Member Typedef Documentation

using RexSubQuery::ExecutionResultShPtr = std::shared_ptr<const ExecutionResult>

Definition at line 322 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexSubQuery::RexSubQuery ( )
inline

Definition at line 326 of file RelAlgDag.h.

326 : result_(new ExecutionResultShPtr(nullptr)) {}
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
std::shared_ptr< const ExecutionResult > ExecutionResultShPtr
Definition: RelAlgDag.h:322
RexSubQuery::RexSubQuery ( const std::shared_ptr< const RelAlgNode ra)
inline

Definition at line 328 of file RelAlgDag.h.

329  : type_(new SQLTypeInfo(kNULLT, false))
330  , result_(new ExecutionResultShPtr(nullptr))
331  , ra_(ra) {}
std::shared_ptr< SQLTypeInfo > type_
Definition: RelAlgDag.h:372
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
std::shared_ptr< const ExecutionResult > ExecutionResultShPtr
Definition: RelAlgDag.h:322
RexSubQuery::RexSubQuery ( std::shared_ptr< SQLTypeInfo type,
std::shared_ptr< ExecutionResultShPtr result,
const std::shared_ptr< const RelAlgNode ra 
)
inline

Definition at line 334 of file RelAlgDag.h.

337  : type_(type), result_(result), ra_(ra) {}
std::shared_ptr< SQLTypeInfo > type_
Definition: RelAlgDag.h:372
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
RexSubQuery::RexSubQuery ( const RexSubQuery )
delete
RexSubQuery::RexSubQuery ( RexSubQuery &&  )
delete

Member Function Documentation

std::unique_ptr< RexSubQuery > RexSubQuery::deepCopy ( ) const

Definition at line 59 of file RelAlgDag.cpp.

59  {
60  return std::make_unique<RexSubQuery>(type_, result_, ra_->deepCopy());
61 }
std::shared_ptr< SQLTypeInfo > type_
Definition: RelAlgDag.h:372
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
ExecutionResultShPtr RexSubQuery::getExecutionResult ( ) const
inline

Definition at line 352 of file RelAlgDag.h.

References CHECK, and result_.

352  {
353  CHECK(result_);
354  CHECK(result_.get());
355  return *(result_.get());
356  }
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
#define CHECK(condition)
Definition: Logger.h:291
unsigned RexSubQuery::getId ( ) const

Definition at line 63 of file RelAlgDag.cpp.

63  {
64  return ra_->getId();
65 }
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
const RelAlgNode* RexSubQuery::getRelAlg ( ) const
inline

Definition at line 360 of file RelAlgDag.h.

References ra_.

360 { return ra_.get(); }
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
const SQLTypeInfo& RexSubQuery::getType ( ) const
inline

Definition at line 347 of file RelAlgDag.h.

References CHECK_NE, kNULLT, and type_.

347  {
348  CHECK_NE(kNULLT, type_->get_type());
349  return *(type_.get());
350  }
#define CHECK_NE(x, y)
Definition: Logger.h:302
std::shared_ptr< SQLTypeInfo > type_
Definition: RelAlgDag.h:372
RexSubQuery& RexSubQuery::operator= ( const RexSubQuery )
delete
RexSubQuery& RexSubQuery::operator= ( RexSubQuery &&  )
delete
void RexSubQuery::setExecutionResult ( const ExecutionResultShPtr  result)

Definition at line 50 of file RelAlgDag.cpp.

References CHECK, CHECK_EQ, and run_benchmark_import::result.

51  {
52  auto row_set = result->getRows();
53  CHECK(row_set);
54  CHECK_EQ(size_t(1), row_set->colCount());
55  *(type_.get()) = row_set->getColType(0);
56  (*(result_.get())) = result;
57 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
std::shared_ptr< SQLTypeInfo > type_
Definition: RelAlgDag.h:372
std::shared_ptr< ExecutionResultShPtr > result_
Definition: RelAlgDag.h:373
#define CHECK(condition)
Definition: Logger.h:291
size_t RexSubQuery::toHash ( ) const
overridevirtual

Implements Rex.

Definition at line 3369 of file RelAlgDag.cpp.

3369  {
3370  if (!hash_) {
3371  hash_ = typeid(RexSubQuery).hash_code();
3372  boost::hash_combine(*hash_, ra_->toHash());
3373  }
3374  return *hash_;
3375 }
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
std::string RexSubQuery::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
overridevirtual

Implements Rex.

Definition at line 3365 of file RelAlgDag.cpp.

References cat(), and typeName().

3365  {
3366  return cat(::typeName(this), "(", ra_->toString(config), ")");
3367 }
std::string cat(Ts &&...args)
std::shared_ptr< const RelAlgNode > ra_
Definition: RelAlgDag.h:374
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 376 of file RelAlgDag.h.

Member Data Documentation

std::shared_ptr<const RelAlgNode> RexSubQuery::ra_
private

Definition at line 374 of file RelAlgDag.h.

Referenced by getRelAlg().

std::shared_ptr<ExecutionResultShPtr> RexSubQuery::result_
private

Definition at line 373 of file RelAlgDag.h.

Referenced by getExecutionResult().

std::shared_ptr<SQLTypeInfo> RexSubQuery::type_
private

Definition at line 372 of file RelAlgDag.h.

Referenced by getType().


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