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

#include <RelAlgExecutionDescriptor.h>

Public Types

enum  RType { QueryResult, SimpleResult, Explanation, 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 64 of file RelAlgExecutionDescriptor.cpp.

References filter_push_down_enabled_, pushed_down_filter_info_, and result_.

65  : targets_meta_(std::move(that.targets_meta_))
68  , success_(that.success_)
70  , type_(that.type_) {
71  if (!pushed_down_filter_info_.empty() ||
73  return;
74  }
75  result_ = std::move(that.result_);
76 }
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 78 of file RelAlgExecutionDescriptor.cpp.

81  : pushed_down_filter_info_(pushed_down_filter_info)
82  , filter_push_down_enabled_(filter_push_down_enabled)
83  , success_(true)
85  , 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(), and RelAlgExecutor::executeSort().

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(), DBHandler::sql_execute(), and DBHandler::sql_execute_df().

75 { return execution_time_ms_; }

+ Here is the caller graph for this function:

std::string ExecutionResult::getExplanation ( )

Definition at line 117 of file RelAlgExecutionDescriptor.cpp.

References empty(), and getRows().

117  {
118  if (!empty()) {
119  return getRows()->getExplanation();
120  }
121  return {};
122 }
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 102 of file RelAlgExecutionDescriptor.cpp.

References pushed_down_filter_info_.

Referenced by DBHandler::execute_rel_alg().

103  {
105 }
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(), and DBHandler::executeDdl().

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(), getExplanation(), result_set_arrow_loopback(), and DBHandler::sql_execute_df().

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(), result_set_arrow_loopback(), and DBHandler::sql_execute_df().

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 87 of file RelAlgExecutionDescriptor.cpp.

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

87  {
88  if (!that.pushed_down_filter_info_.empty() ||
89  (that.filter_push_down_enabled_ && that.pushed_down_filter_info_.empty())) {
92  return *this;
93  }
94  result_ = that.result_;
96  success_ = that.success_;
98  type_ = that.type_;
99  return *this;
100 }
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:291
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:106
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 107 of file RelAlgExecutionDescriptor.cpp.

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

Referenced by ShowCreateTableCommand::execute(), and DBHandler::sql_execute_impl().

109  {
110  targets_meta_.clear();
111  pushed_down_filter_info_.clear();
112  success_ = success;
113  type_ = type;
114  result_ = std::make_shared<ResultSet>(query);
115 }
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: