OmniSciDB  a667adc9c8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExecutionResult Class Reference

#include <RelAlgExecutionDescriptor.h>

Public Types

enum  RType { QueryResult, SimpleResult, Explaination, CalciteDdl }
 

Public Member Functions

 ExecutionResult ()
 
 ExecutionResult (const std::shared_ptr< ResultSet > &rows, const std::vector< TargetMetaInfo > &targets_meta)
 
 ExecutionResult (ResultSetPtr &&result, const std::vector< TargetMetaInfo > &targets_meta)
 
 ExecutionResult (const ExecutionResult &that)
 
 ExecutionResult (ExecutionResult &&that)
 
 ExecutionResult (const std::vector< PushedDownFilterInfo > &pushed_down_filter_info, bool filter_push_down_enabled)
 
ExecutionResultoperator= (const ExecutionResult &that)
 
const std::shared_ptr
< ResultSet > & 
getRows () const
 
bool empty () const
 
const ResultSetPtrgetDataPtr () const
 
const std::vector
< TargetMetaInfo > & 
getTargetsMeta () const
 
const std::vector
< PushedDownFilterInfo > & 
getPushedDownFilterInfo () const
 
const bool isFilterPushDownEnabled () const
 
void setQueueTime (const int64_t queue_time_ms)
 
std::string toString () const
 
std::string getExplanation ()
 
void updateResultSet (const std::string &query_ra, RType type, bool success=true)
 
RType getResultType () const
 
void setResultType (RType type)
 
int64_t getExecutionTime () const
 
void setExecutionTime (int64_t execution_time_ms)
 
void addExecutionTime (int64_t execution_time_ms)
 

Private Attributes

ResultSetPtr result_
 
std::vector< TargetMetaInfotargets_meta_
 
std::vector< PushedDownFilterInfopushed_down_filter_info_
 
bool filter_push_down_enabled_
 
bool success_
 
uint64_t execution_time_ms_
 
RType type_
 

Detailed Description

Definition at line 29 of file RelAlgExecutionDescriptor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ExecutionResult::ExecutionResult ( )
ExecutionResult::ExecutionResult ( const std::shared_ptr< ResultSet > &  rows,
const std::vector< TargetMetaInfo > &  targets_meta 
)
ExecutionResult::ExecutionResult ( ResultSetPtr &&  result,
const std::vector< TargetMetaInfo > &  targets_meta 
)
ExecutionResult::ExecutionResult ( const ExecutionResult that)
ExecutionResult::ExecutionResult ( ExecutionResult &&  that)

Definition at line 62 of file RelAlgExecutionDescriptor.cpp.

References filter_push_down_enabled_, pushed_down_filter_info_, and result_.

63  : targets_meta_(std::move(that.targets_meta_))
66  , success_(true)
68  , type_(QueryResult) {
69  if (!pushed_down_filter_info_.empty() ||
71  return;
72  }
73  result_ = std::move(that.result_);
74 }
std::vector< PushedDownFilterInfo > pushed_down_filter_info_
std::vector< TargetMetaInfo > targets_meta_
ExecutionResult::ExecutionResult ( const std::vector< PushedDownFilterInfo > &  pushed_down_filter_info,
bool  filter_push_down_enabled 
)

Definition at line 76 of file RelAlgExecutionDescriptor.cpp.

79  : pushed_down_filter_info_(pushed_down_filter_info)
80  , filter_push_down_enabled_(filter_push_down_enabled)
81  , success_(true)
83  , type_(QueryResult) {}
std::vector< PushedDownFilterInfo > pushed_down_filter_info_

Member Function Documentation

void ExecutionResult::addExecutionTime ( int64_t  execution_time_ms)
inline

Definition at line 79 of file RelAlgExecutionDescriptor.h.

References execution_time_ms_.

Referenced by DBHandler::execute_rel_alg_with_filter_push_down(), and DBHandler::sql_execute_impl().

79  {
80  execution_time_ms_ += execution_time_ms;
81  }

+ Here is the caller graph for this function:

bool ExecutionResult::empty ( ) const
inline

Definition at line 49 of file RelAlgExecutionDescriptor.h.

References result_.

Referenced by DBHandler::convertData(), DBHandler::executeDdl(), and getExplanation().

49 { return !result_; }

+ Here is the caller graph for this function:

const ResultSetPtr& ExecutionResult::getDataPtr ( ) const
inline

Definition at line 51 of file RelAlgExecutionDescriptor.h.

References result_.

Referenced by DBHandler::convertResultSet().

51 { return result_; }

+ Here is the caller graph for this function:

int64_t ExecutionResult::getExecutionTime ( ) const
inline

Definition at line 75 of file RelAlgExecutionDescriptor.h.

References execution_time_ms_.

Referenced by DBHandler::convertData(), DBHandler::execute_rel_alg(), and DBHandler::sql_execute().

75 { return execution_time_ms_; }

+ Here is the caller graph for this function:

std::string ExecutionResult::getExplanation ( )

Definition at line 115 of file RelAlgExecutionDescriptor.cpp.

References empty(), and getRows().

115  {
116  if (!empty()) {
117  return getRows()->getExplanation();
118  }
119  return {};
120 }
const std::shared_ptr< ResultSet > & getRows() const

+ Here is the call graph for this function:

const std::vector< PushedDownFilterInfo > & ExecutionResult::getPushedDownFilterInfo ( ) const

Definition at line 100 of file RelAlgExecutionDescriptor.cpp.

References pushed_down_filter_info_.

Referenced by DBHandler::execute_rel_alg().

101  {
103 }
std::vector< PushedDownFilterInfo > pushed_down_filter_info_

+ Here is the caller graph for this function:

RType ExecutionResult::getResultType ( ) const
inline

Definition at line 73 of file RelAlgExecutionDescriptor.h.

References type_.

Referenced by DBHandler::convertData().

73 { return type_; }

+ Here is the caller graph for this function:

const std::shared_ptr<ResultSet>& ExecutionResult::getRows ( ) const
inline

Definition at line 47 of file RelAlgExecutionDescriptor.h.

References result_.

Referenced by DBHandler::convertData(), DBHandler::execute_rel_alg(), DBHandler::executeDdl(), RelAlgExecutor::executeSort(), getExplanation(), and result_set_arrow_loopback().

47 { return result_; }

+ Here is the caller graph for this function:

const std::vector<TargetMetaInfo>& ExecutionResult::getTargetsMeta ( ) const
inline

Definition at line 53 of file RelAlgExecutionDescriptor.h.

References targets_meta_.

Referenced by DBHandler::convertData(), DBHandler::convertResultSet(), and result_set_arrow_loopback().

53 { return targets_meta_; }
std::vector< TargetMetaInfo > targets_meta_

+ Here is the caller graph for this function:

const bool ExecutionResult::isFilterPushDownEnabled ( ) const
inline

Definition at line 57 of file RelAlgExecutionDescriptor.h.

References filter_push_down_enabled_.

ExecutionResult & ExecutionResult::operator= ( const ExecutionResult that)

Definition at line 85 of file RelAlgExecutionDescriptor.cpp.

References execution_time_ms_, filter_push_down_enabled_, pushed_down_filter_info_, result_, success_, targets_meta_, and type_.

85  {
86  if (!that.pushed_down_filter_info_.empty() ||
87  (that.filter_push_down_enabled_ && that.pushed_down_filter_info_.empty())) {
90  return *this;
91  }
92  result_ = that.result_;
94  success_ = that.success_;
96  type_ = that.type_;
97  return *this;
98 }
std::vector< PushedDownFilterInfo > pushed_down_filter_info_
std::vector< TargetMetaInfo > targets_meta_
void ExecutionResult::setExecutionTime ( int64_t  execution_time_ms)
inline

Definition at line 76 of file RelAlgExecutionDescriptor.h.

References execution_time_ms_.

Referenced by DBHandler::execute_rel_alg(), DBHandler::executeDdl(), and DBHandler::sql_execute().

76  {
77  execution_time_ms_ = execution_time_ms;
78  }

+ Here is the caller graph for this function:

void ExecutionResult::setQueueTime ( const int64_t  queue_time_ms)
inline

Definition at line 59 of file RelAlgExecutionDescriptor.h.

References CHECK, and result_.

59  {
60  CHECK(result_);
61  result_->setQueueTime(queue_time_ms);
62  }
#define CHECK(condition)
Definition: Logger.h:197
void ExecutionResult::setResultType ( RType  type)
inline

Definition at line 74 of file RelAlgExecutionDescriptor.h.

References run_benchmark_import::type, and type_.

Referenced by DBHandler::execute_rel_alg(), and DBHandler::executeDdl().

+ Here is the caller graph for this function:

std::string ExecutionResult::toString ( ) const
inline

Definition at line 64 of file RelAlgExecutionDescriptor.h.

References result_, targets_meta_, and typeName().

64  {
65  return ::typeName(this) + "(" + ::toString(result_) + ", " +
67  }
std::string toString() const
std::string typeName(const T *v)
Definition: toString.h:82
std::vector< TargetMetaInfo > targets_meta_

+ Here is the call graph for this function:

void ExecutionResult::updateResultSet ( const std::string &  query_ra,
RType  type,
bool  success = true 
)

Definition at line 105 of file RelAlgExecutionDescriptor.cpp.

References pushed_down_filter_info_, result_, success_, targets_meta_, run_benchmark_import::type, and type_.

Referenced by DBHandler::execute_rel_alg_with_filter_push_down(), and DBHandler::sql_execute_impl().

107  {
108  targets_meta_.clear();
109  pushed_down_filter_info_.clear();
110  success_ = success;
111  type_ = type;
112  result_ = std::make_shared<ResultSet>(query);
113 }
std::vector< PushedDownFilterInfo > pushed_down_filter_info_
std::vector< TargetMetaInfo > targets_meta_

+ Here is the caller graph for this function:

Member Data Documentation

uint64_t ExecutionResult::execution_time_ms_
private
bool ExecutionResult::filter_push_down_enabled_
private

Definition at line 89 of file RelAlgExecutionDescriptor.h.

Referenced by ExecutionResult(), isFilterPushDownEnabled(), and operator=().

std::vector<PushedDownFilterInfo> ExecutionResult::pushed_down_filter_info_
private
ResultSetPtr ExecutionResult::result_
private
bool ExecutionResult::success_
private

Definition at line 91 of file RelAlgExecutionDescriptor.h.

Referenced by operator=(), and updateResultSet().

std::vector<TargetMetaInfo> ExecutionResult::targets_meta_
private

Definition at line 85 of file RelAlgExecutionDescriptor.h.

Referenced by getTargetsMeta(), operator=(), toString(), and updateResultSet().

RType ExecutionResult::type_
private

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