Go to the documentation of this file.
43 class simple_aggregations_collector;
44 class aggregation_finalizer;
127 [[nodiscard]]
virtual bool is_equal(
aggregation const& other)
const {
return kind == other.
kind; }
128 [[nodiscard]]
virtual size_t do_hash()
const {
return std::hash<int>{}(
kind); }
129 [[nodiscard]]
virtual std::unique_ptr<aggregation> clone()
const = 0;
132 virtual std::vector<std::unique_ptr<aggregation>> get_simple_aggregations(
133 data_type col_type, cudf::detail::simple_aggregations_collector& collector)
const = 0;
134 virtual void finalize(cudf::detail::aggregation_finalizer& finalizer)
const = 0;
208 enum class udf_type : bool { CUDA, PTX };
209 enum class correlation_type : int32_t { PEARSON, KENDALL, SPEARMAN };
212 template <
typename Base = aggregation>
216 template <
typename Base = aggregation>
220 template <
typename Base = aggregation>
224 template <
typename Base = aggregation>
232 template <
typename Base = aggregation>
236 template <
typename Base = aggregation>
240 template <
typename Base = aggregation>
244 template <
typename Base = aggregation>
248 template <
typename Base = aggregation>
262 template <
typename Base = aggregation>
273 template <
typename Base = aggregation>
284 template <
typename Base = aggregation>
288 template <
typename Base = aggregation>
297 template <
typename Base = aggregation>
306 template <
typename Base = aggregation>
314 template <
typename Base = aggregation>
323 template <
typename Base = aggregation>
339 template <
typename Base = aggregation>
344 template <
typename Base = aggregation>
418 template <
typename Base = aggregation>
420 order column_order = order::ASCENDING,
422 null_order null_precedence = null_order::AFTER,
435 template <
typename Base = aggregation>
454 template <
typename Base = aggregation>
460 template <
typename Base = aggregation>
464 template <
typename Base = aggregation>
476 template <
typename Base = aggregation>
478 std::string
const& user_defined_aggregator,
490 template <
typename Base = aggregation>
514 template <
typename Base = aggregation>
530 template <
typename Base = aggregation>
542 template <
typename Base = aggregation>
554 template <
typename Base = aggregation>
592 template <
typename Base>
630 template <
typename Base>
rank_method
Tie-breaker method to use for ranking the column.
Derived class intended for scan usage.
std::unique_ptr< Base > make_variance_aggregation(size_type ddof=1)
Factory to create a VARIANCE aggregation.
std::unique_ptr< table > quantiles(table_view const &input, std::vector< double > const &q, interpolation interp=interpolation::NEAREST, cudf::sorted is_input_sorted=sorted::NO, std::vector< order > const &column_order={}, std::vector< null_order > const &null_precedence={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the rows of the input corresponding to the requested quantiles.
std::unique_ptr< Base > make_m2_aggregation()
Factory to create a M2 aggregation.
Kind kind
The aggregation to perform.
@ MIN
min of first in the group
int32_t size_type
Row index type for columns and tables.
Derived class intended for reduction usage.
null_policy
Enum to specify whether to include nulls or exclude nulls.
@ NTH_ELEMENT
get the nth element
std::unique_ptr< Base > make_argmax_aggregation()
Factory to create an argmax aggregation.
std::unique_ptr< Base > make_min_aggregation()
Factory to create a MIN aggregation.
Type declarations for libcudf.
interpolation
Interpolation method to use when the desired quantile lies between two data points i and j.
std::unique_ptr< Base > make_row_number_aggregation()
Factory to create a ROW_NUMBER aggregation.
std::unique_ptr< Base > make_merge_lists_aggregation()
Factory to create a MERGE_LISTS aggregation.
std::unique_ptr< Base > make_sum_aggregation()
Factory to create a SUM aggregation.
@ COUNT_VALID
count number of valid elements
@ ARGMAX
Index of max element.
@ PRODUCT
product reduction
@ COLLECT_LIST
collect values into a list
@ MAX
max of first in the group
Derived class intended for segmented reduction usage.
@ CUDA
CUDA UDF based reduction.
std::unique_ptr< Base > make_lag_aggregation(size_type offset)
Factory to create a LAG aggregation.
std::unique_ptr< Base > make_any_aggregation()
Factory to create an ANY aggregation.
Derived class intended for groupby specific aggregation usage.
std::unique_ptr< Base > make_sum_of_squares_aggregation()
Factory to create a SUM_OF_SQUARES aggregation.
@ ARGMIN
Index of min element.
std::unique_ptr< Base > make_product_aggregation()
Factory to create a PRODUCT aggregation.
@ RANK
get rank of current index
null_order
Indicates how null values compare against all other values.
Derived class intended for groupby specific scan usage.
@ CORRELATION
correlation between two sets of elements
std::unique_ptr< Base > make_covariance_aggregation(size_type min_periods=1, size_type ddof=1)
Factory to create a COVARIANCE aggregation.
@ MERGE_SETS
merge multiple lists values into one list then drop duplicate entries
@ MEAN
arithmetic mean reduction
nan_equality
Enum to consider different elements (of floating point types) holding NaN value as equal or unequal.
std::unique_ptr< Base > make_nunique_aggregation(null_policy null_handling=null_policy::EXCLUDE)
Factory to create a nunique aggregation.
@ ALL_EQUAL
All NaNs compare equal, regardless of sign.
std::unique_ptr< Base > make_merge_m2_aggregation()
Factory to create a MERGE_M2 aggregation.
std::unique_ptr< Base > make_merge_tdigest_aggregation(int max_centroids=1000)
Factory to create a MERGE_TDIGEST aggregation.
@ QUANTILE
compute specified quantile(s)
@ MERGE_M2
merge partial values of M2 aggregation,
std::unique_ptr< Base > make_all_aggregation()
Factory to create a ALL aggregation.
@ MERGE_LISTS
merge multiple lists values into one list
@ LEAD
window function, accesses row at specified offset following current row
std::unique_ptr< Base > make_tdigest_aggregation(int max_centroids=1000)
Factory to create a TDIGEST aggregation.
std::unique_ptr< Base > make_mean_aggregation()
Factory to create a MEAN aggregation.
std::unique_ptr< Base > make_rank_aggregation(rank_method method, order column_order=order::ASCENDING, null_policy null_handling=null_policy::EXCLUDE, null_order null_precedence=null_order::AFTER, rank_percentage percentage=rank_percentage::NONE)
Factory to create a RANK aggregation.
std::unique_ptr< Base > make_merge_sets_aggregation(null_equality nulls_equal=null_equality::EQUAL, nan_equality nans_equal=nan_equality::UNEQUAL)
Factory to create a MERGE_SETS aggregation.
@ LAG
window function, accesses row at specified offset preceding current row
std::unique_ptr< Base > make_count_aggregation(null_policy null_handling=null_policy::EXCLUDE)
Factory to create a COUNT aggregation.
Indicator for the logical data type of an element in a column.
rank_percentage
Whether returned rank should be percentage or not and mention the type of percentage normalization.
@ MERGE_TDIGEST
create a tdigest by merging multiple tdigests together
std::unique_ptr< Base > make_nth_element_aggregation(size_type n, null_policy null_handling=null_policy::INCLUDE)
Factory to create a nth_element aggregation.
std::unique_ptr< Base > make_collect_list_aggregation(null_policy null_handling=null_policy::INCLUDE)
Factory to create a COLLECT_LIST aggregation.
Derived class intended for rolling_window specific aggregation usage.
@ SUM_OF_SQUARES
sum of squares reduction
std::unique_ptr< Base > make_std_aggregation(size_type ddof=1)
Factory to create a STD aggregation.
@ M2
sum of squares of differences from the mean
@ COLLECT_SET
collect values into a list without duplicate entries
@ PTX
PTX UDF based reduction.
@ EXCLUDE
exclude null elements
@ TDIGEST
create a tdigest from a set of input values
std::unique_ptr< Base > make_correlation_aggregation(correlation_type type, size_type min_periods=1)
Factory to create a CORRELATION aggregation.
std::unique_ptr< Base > make_max_aggregation()
Factory to create a MAX aggregation.
@ FIRST
stable sort order ranking (no ties)
std::unique_ptr< Base > make_median_aggregation()
Factory to create a MEDIAN aggregation.
null_equality
Enum to consider two nulls as equal or unequal.
@ ROW_NUMBER
get row-number of current index (relative to rolling window)
std::unique_ptr< Base > make_argmin_aggregation()
Factory to create an argmin aggregation.
Abstract base class for specifying the desired aggregation in an aggregation_request.
std::unique_ptr< Base > make_lead_aggregation(size_type offset)
Factory to create a LEAD aggregation.
std::unique_ptr< Base > make_quantile_aggregation(std::vector< double > const &quantiles, interpolation interp=interpolation::LINEAR)
Factory to create a QUANTILE aggregation.
@ COUNT_ALL
count number of elements
Kind
Possible aggregation operations.
std::unique_ptr< Base > make_udf_aggregation(udf_type type, std::string const &user_defined_aggregator, data_type output_type)
Factory to create an aggregation base on UDF for PTX or CUDA.
std::unique_ptr< Base > make_collect_set_aggregation(null_policy null_handling=null_policy::INCLUDE, null_equality nulls_equal=null_equality::EQUAL, nan_equality nans_equal=nan_equality::UNEQUAL)
Factory to create a COLLECT_SET aggregation.
@ NUNIQUE
count number of unique elements
@ COVARIANCE
covariance between two sets of elements
order
Indicates the order in which elements should be sorted.