OmniSciDB  29e35f4d58
AggregateReductionEgress< META_TYPE_CLASS > Class Template Reference

Public Types

using ReturnType = void
 

Public Member Functions

ReturnType operator() (int const entry_count, int &error_code, TargetInfo const &agg_info, size_t &out_vec_idx, std::vector< int64_t *> &out_vec, std::vector< int64_t > &reduced_outs, QueryExecutionContext *query_exe_context)
 

Detailed Description

template<typename META_TYPE_CLASS>
class AggregateReductionEgress< META_TYPE_CLASS >

Definition at line 2174 of file Execute.cpp.

Member Typedef Documentation

◆ ReturnType

template<typename META_TYPE_CLASS >
using AggregateReductionEgress< META_TYPE_CLASS >::ReturnType = void

Definition at line 2176 of file Execute.cpp.

Member Function Documentation

◆ operator()()

template<typename META_TYPE_CLASS >
ReturnType AggregateReductionEgress< META_TYPE_CLASS >::operator() ( int const  entry_count,
int &  error_code,
TargetInfo const &  agg_info,
size_t &  out_vec_idx,
std::vector< int64_t *> &  out_vec,
std::vector< int64_t > &  reduced_outs,
QueryExecutionContext query_exe_context 
)
inline

Definition at line 2179 of file Execute.cpp.

References TargetInfo::agg_kind, CHECK, QueryExecutionContext::getAggInitValForIndex(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), is_distinct_target(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_geometry(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen(), kAPPROX_COUNT_DISTINCT, kAVG, kCOUNT, kSAMPLE, QueryExecutionContext::query_mem_desc_, Executor::reduceResults(), TargetInfo::sql_type, and takes_float_argument().

2185  {
2186  int64_t val1;
2187  const bool float_argument_input = takes_float_argument(agg_info);
2188  if (is_distinct_target(agg_info)) {
2189  CHECK(agg_info.agg_kind == kCOUNT || agg_info.agg_kind == kAPPROX_COUNT_DISTINCT);
2190  val1 = out_vec[out_vec_idx][0];
2191  error_code = 0;
2192  } else {
2193  const auto chosen_bytes = static_cast<size_t>(
2194  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx));
2195  std::tie(val1, error_code) =
2196  Executor::reduceResults(agg_info.agg_kind,
2197  agg_info.sql_type,
2198  query_exe_context->getAggInitValForIndex(out_vec_idx),
2199  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2200  out_vec[out_vec_idx],
2201  entry_count,
2202  false,
2203  float_argument_input);
2204  }
2205  if (error_code) {
2206  return;
2207  }
2208  reduced_outs.push_back(val1);
2209  if (agg_info.agg_kind == kAVG ||
2210  (agg_info.agg_kind == kSAMPLE &&
2211  (agg_info.sql_type.is_varlen() || agg_info.sql_type.is_geometry()))) {
2212  const auto chosen_bytes = static_cast<size_t>(
2213  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx + 1));
2214  int64_t val2;
2215  std::tie(val2, error_code) = Executor::reduceResults(
2216  agg_info.agg_kind == kAVG ? kCOUNT : agg_info.agg_kind,
2217  agg_info.sql_type,
2218  query_exe_context->getAggInitValForIndex(out_vec_idx + 1),
2219  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2220  out_vec[out_vec_idx + 1],
2221  entry_count,
2222  false,
2223  false);
2224  if (error_code) {
2225  return;
2226  }
2227  reduced_outs.push_back(val2);
2228  ++out_vec_idx;
2229  }
2230  ++out_vec_idx;
2231  }
static std::pair< int64_t, int32_t > reduceResults(const SQLAgg agg, const SQLTypeInfo &ti, const int64_t agg_init_val, const int8_t out_byte_width, const int64_t *out_vec, const size_t out_vec_sz, const bool is_group_by, const bool float_argument_input)
Definition: Execute.cpp:611
bool takes_float_argument(const TargetInfo &target_info)
Definition: TargetInfo.h:121
int64_t getAggInitValForIndex(const size_t index) const
const int8_t getPaddedSlotWidthBytes(const size_t slot_idx) const
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
bool is_distinct_target(const TargetInfo &target_info)
Definition: TargetInfo.h:117
Definition: sqldefs.h:76
#define CHECK(condition)
Definition: Logger.h:193
Definition: sqldefs.h:72
const QueryMemoryDescriptor query_mem_desc_
+ Here is the call graph for this function:

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