OmniSciDB  6686921089
 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 44 of file ExecutionKernel.cpp.

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

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

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

References need_to_hold_chunk().

83  {
84  for (const auto& chunk : chunks) {
85  if (need_to_hold_chunk(chunk.get(), ra_exe_unit, lazy_fetch_info, device_type)) {
86  return true;
87  }
88  }
89 
90  return false;
91 }
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 31 of file ExecutionKernel.cpp.

Referenced by SharedKernelContext::addDeviceResults().

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

+ 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 35 of file ExecutionKernel.cpp.

References INNER, and RelAlgExecutionUnit::join_quals.

Referenced by ExecutionKernel::runImpl().

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

+ Here is the caller graph for this function: