Turi Create  4.0
turi::groupby_aggregate_impl::groupby_element Struct Reference

#include <core/storage/sframe_data/groupby_aggregate_impl.hpp>

Public Member Functions

 groupby_element (std::vector< flexible_type > group_key, const std::vector< group_descriptor > &group_desc)
 
 groupby_element (const std::string &val, const std::vector< group_descriptor > &group_desc)
 
void init (std::vector< flexible_type > group_key, const std::vector< group_descriptor > &group_desc)
 
void save (oarchive &oarc) const
 Writes the group result into an output archive.
 
void load (iarchive &iarc, const std::vector< group_descriptor > &group_desc)
 
bool operator> (const groupby_element &other) const
 
bool operator< (const groupby_element &other) const
 
bool operator== (const groupby_element &other) const
 
void operator+= (const groupby_element &other)
 

Public Attributes

std::vector< flexible_typekey
 The key of this aggregation.
 
std::vector< std::unique_ptr< group_aggregate_value > > values
 All the aggregated values.
 
size_t hash_val
 A cache of the hash of the key.
 

Detailed Description

This class manages all the intermedate aggregation result of a given key. It contains a key, and an array of multiple aggregated values for that key (each aggregated value is for a different aggregator. For instance, one could be sum, one could be count). It then provides

Definition at line 53 of file groupby_aggregate_impl.hpp.

Constructor & Destructor Documentation

◆ groupby_element() [1/2]

turi::groupby_aggregate_impl::groupby_element::groupby_element ( std::vector< flexible_type group_key,
const std::vector< group_descriptor > &  group_desc 
)

Constructs a group element from a key, and a description of all the group operations. All the aggregated values will be initialized as new empty values.

◆ groupby_element() [2/2]

turi::groupby_aggregate_impl::groupby_element::groupby_element ( const std::string &  val,
const std::vector< group_descriptor > &  group_desc 
)

Constructs a groupby_element from a string which contains a serialization of the element. The array of all the descriptors is required.

Member Function Documentation

◆ init()

void turi::groupby_aggregate_impl::groupby_element::init ( std::vector< flexible_type group_key,
const std::vector< group_descriptor > &  group_desc 
)

Constructs a group element from a key, and a description of all the group operations. All the aggregated values will be initialized as new empty values.

◆ load()

void turi::groupby_aggregate_impl::groupby_element::load ( iarchive iarc,
const std::vector< group_descriptor > &  group_desc 
)

Loads the group result from an input archive and a group operation descriptor

◆ operator+=()

void turi::groupby_aggregate_impl::groupby_element::operator+= ( const groupby_element other)

Combines values another groupby element which is performing the same set of operations

◆ operator<()

bool turi::groupby_aggregate_impl::groupby_element::operator< ( const groupby_element other) const

Provides a total ordering on group-by elements

◆ operator==()

bool turi::groupby_aggregate_impl::groupby_element::operator== ( const groupby_element other) const

Returns true if this, and other have identical keys

◆ operator>()

bool turi::groupby_aggregate_impl::groupby_element::operator> ( const groupby_element other) const

Provides a total ordering on group-by elements


The documentation for this struct was generated from the following file: