OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 2164 of file Execute.cpp.

Member Typedef Documentation

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

Definition at line 2166 of file Execute.cpp.

Member Function Documentation

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 2169 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().

2175  {
2176  int64_t val1;
2177  const bool float_argument_input = takes_float_argument(agg_info);
2178  if (is_distinct_target(agg_info)) {
2179  CHECK(agg_info.agg_kind == kCOUNT || agg_info.agg_kind == kAPPROX_COUNT_DISTINCT);
2180  val1 = out_vec[out_vec_idx][0];
2181  error_code = 0;
2182  } else {
2183  const auto chosen_bytes = static_cast<size_t>(
2184  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx));
2185  std::tie(val1, error_code) =
2186  Executor::reduceResults(agg_info.agg_kind,
2187  agg_info.sql_type,
2188  query_exe_context->getAggInitValForIndex(out_vec_idx),
2189  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2190  out_vec[out_vec_idx],
2191  entry_count,
2192  false,
2193  float_argument_input);
2194  }
2195  if (error_code) {
2196  return;
2197  }
2198  reduced_outs.push_back(val1);
2199  if (agg_info.agg_kind == kAVG ||
2200  (agg_info.agg_kind == kSAMPLE &&
2201  (agg_info.sql_type.is_varlen() || agg_info.sql_type.is_geometry()))) {
2202  const auto chosen_bytes = static_cast<size_t>(
2203  query_exe_context->query_mem_desc_.getPaddedSlotWidthBytes(out_vec_idx + 1));
2204  int64_t val2;
2205  std::tie(val2, error_code) = Executor::reduceResults(
2206  agg_info.agg_kind == kAVG ? kCOUNT : agg_info.agg_kind,
2207  agg_info.sql_type,
2208  query_exe_context->getAggInitValForIndex(out_vec_idx + 1),
2209  float_argument_input ? sizeof(int32_t) : chosen_bytes,
2210  out_vec[out_vec_idx + 1],
2211  entry_count,
2212  false,
2213  false);
2214  if (error_code) {
2215  return;
2216  }
2217  reduced_outs.push_back(val2);
2218  ++out_vec_idx;
2219  }
2220  ++out_vec_idx;
2221  }
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:614
bool takes_float_argument(const TargetInfo &target_info)
Definition: TargetInfo.h:120
CHECK(cgen_state)
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
const int8_t getPaddedSlotWidthBytes(const size_t slot_idx) const
int64_t getAggInitValForIndex(const size_t index) const
Definition: sqldefs.h:71
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: