26 #include <rapidjson/document.h>
40 : predicate_op(predicate_op)
41 , filter_val(filter_val)
98 ,
min(std::numeric_limits<
T>::
max())
99 ,
max(std::numeric_limits<
T>::lowest())
122 const std::string& stats_requests_json_str,
123 const int64_t num_attrs);
125 template <
typename TA>
131 const std::string request_str_key =
133 auto stats_map_itr = stats_map.find(request_str_key);
134 if (stats_map_itr != stats_map.end()) {
135 return stats_map_itr->second;
138 stats_map[request_str_key] = column_stats;
142 template <
typename TA>
144 std::vector<StatsRequest>& stats_requests) {
145 std::unordered_map<std::string, ColumnStats<TA>> stats_map;
147 for (
auto& stats_request : stats_requests) {
148 const auto column_stats =
get_column_stats(attrs, stats_request, stats_map);
149 switch (stats_request.agg_type) {
151 stats_request.result = column_stats.non_null_or_filtered_count;
155 stats_request.result = column_stats.min;
159 stats_request.result = column_stats.max;
163 stats_request.result = column_stats.sum;
167 stats_request.result = column_stats.mean;
174 template <
typename TA>
177 const std::vector<StatsRequest>& stats_requests) {
178 const int64_t num_requests =
static_cast<int64_t
>(stats_requests.size());
186 template <
typename T>
189 const int64_t num_rows,
192 template <
typename T>
bool operator==(StatsRequestPredicate const &rhs) const
std::vector< StatsRequest > parse_stats_requests_json(const std::string &stats_requests_json_str, const int64_t num_attrs)
NEVER_INLINE HOST ColumnStats< T > get_column_stats(const T *data, const int64_t num_rows, const StatsRequestPredicate &predicate)
std::string to_string() const
StatsRequestPredicate(const StatsRequestPredicate &other)
void populate_output_stats_cols(Column< TextEncodingDict > &stat_names, Column< TA > &stat_vals, const std::vector< StatsRequest > &stats_requests)
StringDictionaryProxy * string_dict_proxy_
int64_t non_null_or_filtered_count
bool g_enable_smem_group_by true
int32_t getOrAddTransient(const std::string &)
void compute_stats_requests(const ColumnList< TA > &attrs, std::vector< StatsRequest > &stats_requests)
StatsRequestPredicateOp filter_type
StatsRequestPredicateOp predicate_op
StatsRequestPredicate(const StatsRequestPredicateOp predicate_op, const double filter_val)
bool operator()(const T val) const
bool g_enable_watchdog false
StatsRequestAggType agg_type