Aggregates¶
Typed aggregate functions for use with the typed DataFrame constructor.
Pass aggregate columns alongside .group() columns when constructing a typed
DataFrame — see DataFrame for usage.
Implemented¶
count, count_distinct, count_if, countDistinct, approx_count_distinct, sum / sum_distinct / sumDistinct (integral → Long, Float/Double → Double), avg, mean, stddev, stddev_samp, stddev_pop, corr, covar_pop, covar_samp, collect_list, collect_set, min, max, min_by, max_by, first, last
Not yet implemented (contributions welcome)¶
variance / var_samp / var_pop — Column → Double kurtosis — Column → Double skewness — Column → Double median — Column → Double mode — Column → C percentile_approx — (Column, percentage, accuracy) → Double bit_and / bit_or / bit_xor — C → C (integer columns) nth_value — (C, offset) → C any_value — C → C
sum ¶
collect_list ¶
collect_list(col: C) -> Array[C]
Aggregates values of col into an array, preserving duplicates and order.
Wrapper for pyspark.sql.functions.collect_list.
collect_set ¶
collect_set(col: C) -> Array[C]
Aggregates unique values of col into an array.
Wrapper for pyspark.sql.functions.collect_set.