OmniSciDB  04ee39c94c
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 2037 of file Execute.cpp.

Member Typedef Documentation

◆ ReturnType

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

Definition at line 2039 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 2042 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().

2048  {
2049  int64_t val1;
2050  const bool float_argument_input = takes_float_argument(agg_info);
2051  if (is_distinct_target(agg_info)) {
2052  CHECK(agg_info.agg_kind == kCOUNT || agg_info.agg_kind == kAPPROX_COUNT_DISTINCT);
2053  val1 = out_vec[out_vec_idx][0];
2054  error_code = 0;
2055  } else {
2056  const auto chosen_bytes = static_cast<size_t>(
2057  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx));
2058  std::tie(val1, error_code) =
2059  Executor::reduceResults(agg_info.agg_kind,
2060  agg_info.sql_type,
2061  query_exe_context->getAggInitValForIndex(out_vec_idx),
2062  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2063  out_vec[out_vec_idx],
2064  entry_count,
2065  false,
2066  float_argument_input);
2067  }
2068  if (error_code) {
2069  return;
2070  }
2071  reduced_outs.push_back(val1);
2072  if (agg_info.agg_kind == kAVG ||
2073  (agg_info.agg_kind == kSAMPLE &&
2074  (agg_info.sql_type.is_varlen() || agg_info.sql_type.is_geometry()))) {
2075  const auto chosen_bytes = static_cast<size_t>(
2076  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx + 1));
2077  int64_t val2;
2078  std::tie(val2, error_code) = Executor::reduceResults(
2079  agg_info.agg_kind == kAVG ? kCOUNT : agg_info.agg_kind,
2080  agg_info.sql_type,
2081  query_exe_context->getAggInitValForIndex(out_vec_idx + 1),
2082  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2083  out_vec[out_vec_idx + 1],
2084  entry_count,
2085  false,
2086  false);
2087  if (error_code) {
2088  return;
2089  }
2090  reduced_outs.push_back(val2);
2091  ++out_vec_idx;
2092  }
2093  ++out_vec_idx;
2094  }
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:601
bool takes_float_argument(const TargetInfo &target_info)
Definition: TargetInfo.h:120
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:116
Definition: sqldefs.h:71
#define CHECK(condition)
Definition: Logger.h:187
Definition: sqldefs.h:71
const QueryMemoryDescriptor query_mem_desc_
+ Here is the call graph for this function:

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