OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{ExecutionKernel.cpp} Namespace Reference

Functions

bool needs_skip_result (const ResultSetPtr &res)
 
bool query_has_inner_join (const RelAlgExecutionUnit &ra_exe_unit)
 
bool need_to_hold_chunk (const Chunk_NS::Chunk *chunk, const RelAlgExecutionUnit &ra_exe_unit, const std::vector< ColumnLazyFetchInfo > &lazy_fetch_info, const ExecutorDeviceType device_type)
 
bool need_to_hold_chunk (const std::list< std::shared_ptr< Chunk_NS::Chunk >> &chunks, const RelAlgExecutionUnit &ra_exe_unit, const std::vector< ColumnLazyFetchInfo > &lazy_fetch_info, const ExecutorDeviceType device_type)
 

Function Documentation

bool anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk ( const Chunk_NS::Chunk chunk,
const RelAlgExecutionUnit ra_exe_unit,
const std::vector< ColumnLazyFetchInfo > &  lazy_fetch_info,
const ExecutorDeviceType  device_type 
)

Definition at line 45 of file ExecutionKernel.cpp.

References CHECK, CHECK_EQ, ColumnDescriptor::columnId, ColumnDescriptor::columnType, CPU, Chunk_NS::Chunk::getColumnDesc(), kENCODING_NONE, ColumnDescriptor::tableId, and RelAlgExecutionUnit::target_exprs.

Referenced by need_to_hold_chunk(), and ExecutionKernel::runImpl().

48  {
49  CHECK(chunk->getColumnDesc());
50  const auto& chunk_ti = chunk->getColumnDesc()->columnType;
51  if (device_type == ExecutorDeviceType::CPU &&
52  (chunk_ti.is_array() ||
53  (chunk_ti.is_string() && chunk_ti.get_compression() == kENCODING_NONE))) {
54  for (const auto target_expr : ra_exe_unit.target_exprs) {
55  const auto col_var = dynamic_cast<const Analyzer::ColumnVar*>(target_expr);
56  if (col_var && col_var->get_column_id() == chunk->getColumnDesc()->columnId &&
57  col_var->get_table_id() == chunk->getColumnDesc()->tableId) {
58  return true;
59  }
60  }
61  }
62  if (lazy_fetch_info.empty()) {
63  return false;
64  }
65  CHECK_EQ(lazy_fetch_info.size(), ra_exe_unit.target_exprs.size());
66  for (size_t i = 0; i < ra_exe_unit.target_exprs.size(); i++) {
67  const auto target_expr = ra_exe_unit.target_exprs[i];
68  const auto& col_lazy_fetch = lazy_fetch_info[i];
69  const auto col_var = dynamic_cast<const Analyzer::ColumnVar*>(target_expr);
70  if (col_var && col_var->get_column_id() == chunk->getColumnDesc()->columnId &&
71  col_var->get_table_id() == chunk->getColumnDesc()->tableId) {
72  if (col_lazy_fetch.is_lazily_fetched) {
73  // hold lazy fetched inputs for later iteration
74  return true;
75  }
76  }
77  }
78  return false;
79 }
std::vector< Analyzer::Expr * > target_exprs
#define CHECK_EQ(x, y)
Definition: Logger.h:231
const ColumnDescriptor * getColumnDesc() const
Definition: Chunk.h:65
#define CHECK(condition)
Definition: Logger.h:223
SQLTypeInfo columnType

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk ( const std::list< std::shared_ptr< Chunk_NS::Chunk >> &  chunks,
const RelAlgExecutionUnit ra_exe_unit,
const std::vector< ColumnLazyFetchInfo > &  lazy_fetch_info,
const ExecutorDeviceType  device_type 
)

Definition at line 81 of file ExecutionKernel.cpp.

References need_to_hold_chunk().

84  {
85  for (const auto& chunk : chunks) {
86  if (need_to_hold_chunk(chunk.get(), ra_exe_unit, lazy_fetch_info, device_type)) {
87  return true;
88  }
89  }
90 
91  return false;
92 }
bool need_to_hold_chunk(const Chunk_NS::Chunk *chunk, const RelAlgExecutionUnit &ra_exe_unit, const std::vector< ColumnLazyFetchInfo > &lazy_fetch_info, const ExecutorDeviceType device_type)

+ Here is the call graph for this function:

bool anonymous_namespace{ExecutionKernel.cpp}::needs_skip_result ( const ResultSetPtr res)

Definition at line 32 of file ExecutionKernel.cpp.

Referenced by SharedKernelContext::addDeviceResults().

32  {
33  return !res || res->definitelyHasNoRows();
34 }

+ Here is the caller graph for this function:

bool anonymous_namespace{ExecutionKernel.cpp}::query_has_inner_join ( const RelAlgExecutionUnit ra_exe_unit)
inline

Definition at line 36 of file ExecutionKernel.cpp.

References INNER, and RelAlgExecutionUnit::join_quals.

Referenced by ExecutionKernel::runImpl().

36  {
37  return (std::count_if(ra_exe_unit.join_quals.begin(),
38  ra_exe_unit.join_quals.end(),
39  [](const auto& join_condition) {
40  return join_condition.type == JoinType::INNER;
41  }) > 0);
42 }
const JoinQualsPerNestingLevel join_quals

+ Here is the caller graph for this function: