Turi Create
4.0
|
#include <core/storage/sframe_data/group_aggregate_value.hpp>
Public Member Functions | |
virtual group_aggregate_value * | new_instance () const =0 |
virtual void | add_element (const std::vector< flexible_type > &values) |
virtual void | add_element_simple (const flexible_type &flex)=0 |
virtual void | partial_finalize () |
virtual void | combine (const group_aggregate_value &other)=0 |
virtual flexible_type | emit () const =0 |
virtual bool | support_type (flex_type_enum type) const =0 |
virtual flex_type_enum | set_input_types (const std::vector< flex_type_enum > &types) |
virtual std::string | name () const =0 |
virtual void | save (oarchive &oarc) const =0 |
virtual void | load (iarchive &iarc)=0 |
virtual | ~group_aggregate_value () |
virtual void | print (std::ostream &os) const |
The base class specification for representing the intermediate state as well as the computation (aggregation, combining and output) for an aggregation operation.
Essentially, the group_aggregate_value must describe a parallel reduction in the following form:
Each value could have an arbitrary number of elements inserted into it. When all insertions are complete, partial_finalize() is called on the value. Values can be combined with each other to form a final value, which then emits a response.
Definition at line 45 of file group_aggregate_value.hpp.
|
inlinevirtual |
Destruction
Definition at line 125 of file group_aggregate_value.hpp.
|
inlinevirtual |
Adds an element to the aggregate. Elements to be added will be either the input_type (as set by set_input_type()) or UNDEFINED.
Operator that expects more than one input values need to overwrite this function
Reimplemented in turi::groupby_operators::zip_dict, turi::groupby_operators::argmax, and turi::groupby_operators::argmin.
Definition at line 60 of file group_aggregate_value.hpp.
|
pure virtual |
Adds an element to the aggregate. Simple version of add_element where there is only one input value for the operator
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::query_eval::generic_aggregator< T, AggregateFunctionType >, and turi::groupby_operators::vector_sum.
|
pure virtual |
Combines two partial aggregates
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.
|
pure virtual |
Emits the result of a groupby operation
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::distinct, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.
|
pure virtual |
Loads the state of the aggregation from an archive
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.
|
pure virtual |
Returns a printable name of the operation.
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::distinct, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.
|
pure virtual |
Creates a new instance of the aggregator. The new instance must remember the input type (see set_input_type()) but have have a new empty value.
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::distinct, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::query_eval::generic_aggregator< T, AggregateFunctionType >, and turi::groupby_operators::vector_sum.
|
inlinevirtual |
No more elements will be added to this value. However, this value may still be combined with other values.
Reimplemented in turi::groupby_operators::quantile.
Definition at line 75 of file group_aggregate_value.hpp.
|
inlinevirtual |
Override this function for allowing the operator to be easily printed.
Reimplemented in turi::groupby_operators::variance.
Definition at line 134 of file group_aggregate_value.hpp.
|
pure virtual |
Saves the state of the aggregation to an archive
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.
|
inlinevirtual |
Sets the input types and returns the output type. For instance, a sum aggregator when summing integers will return an integer, and when summing doubles will return doubles.
Default implementation assumes there is ony one input, and output type is the same as input type.
Reimplemented in turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::argmax, and turi::groupby_operators::argmin.
Definition at line 102 of file group_aggregate_value.hpp.
|
pure virtual |
Returns true if the the aggregate_value can consume a column of this type, and false otherwise. (For instance, a sum aggregator can consume integers and floats, and not anything else).
Implemented in turi::groupby_operators::frequency_count, turi::groupby_operators::count_distinct, turi::groupby_operators::select_one, turi::groupby_operators::zip_list, turi::groupby_operators::zip_dict, turi::groupby_operators::quantile, turi::groupby_operators::variance, turi::groupby_operators::average, turi::groupby_operators::vector_average, turi::groupby_operators::non_null_count, turi::groupby_operators::count, turi::groupby_operators::max, turi::groupby_operators::argmax, turi::groupby_operators::argmin, turi::groupby_operators::min, turi::groupby_operators::sum, turi::groupby_operators::vector_sum, and turi::query_eval::generic_aggregator< T, AggregateFunctionType >.