Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::DistinctAggregateData Struct Reference
Collaboration diagram for duckdb::DistinctAggregateData:

Public Member Functions

 DistinctAggregateData (const DistinctAggregateCollectionInfo &info, TupleDataValidityType distinct_validity)
 Persistent + shared (read-only) data for the distinct aggregates.
 DistinctAggregateData (const DistinctAggregateCollectionInfo &info, const GroupingSet &groups, const vector< unique_ptr< Expression > > *group_expressions, TupleDataValidityType distinct_validity)
bool IsDistinct (idx_t index) const

Public Attributes

vector< unique_ptr< GroupedAggregateData > > grouped_aggregate_data
 The data used by the hashtables.
vector< unique_ptr< RadixPartitionedHashTable > > radix_tables
 The hashtables.
vector< GroupingSet > grouping_sets
 The groups (arguments).
const DistinctAggregateCollectionInfo & info

Constructor & Destructor Documentation

◆ DistinctAggregateData() [1/2]

duckdb::DistinctAggregateData::DistinctAggregateData ( const DistinctAggregateCollectionInfo & info,
TupleDataValidityType distinct_validity )

Persistent + shared (read-only) data for the distinct aggregates.

159709 : DistinctAggregateData(info, {}, nullptr, distinct_validity) {
159710}
DistinctAggregateData(const DistinctAggregateCollectionInfo &info, TupleDataValidityType distinct_validity)
Persistent + shared (read-only) data for the distinct aggregates.
Definition duckdb.cpp:159707
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DistinctAggregateData() [2/2]

duckdb::DistinctAggregateData::DistinctAggregateData ( const DistinctAggregateCollectionInfo & info,
const GroupingSet & groups,
const vector< unique_ptr< Expression > > * group_expressions,
TupleDataValidityType distinct_validity )

This aggregate shares a table with another aggregate, and the table is already initialized

Populate the group with the children of the aggregate

159715 : info(info) {
159716 grouped_aggregate_data.resize(info.table_count);
159717 radix_tables.resize(info.table_count);
159718 grouping_sets.resize(info.table_count);
159719
159720 for (auto &i : info.indices) {
159721 auto &aggregate = info.aggregates[i]->Cast<BoundAggregateExpression>();
159722
159723 D_ASSERT(info.table_map.count(i));
159724 idx_t table_idx = info.table_map.at(i);
159725 if (radix_tables[table_idx] != nullptr) {
159727 continue;
159728 }
159729 // The grouping set contains the indices of the chunk that correspond to the data vector
159730 // that will be used to figure out in which bucket the payload should be put
159731 auto &grouping_set = grouping_sets[table_idx];
159733 for (auto &group : groups) {
159734 grouping_set.insert(group);
159735 }
159736 idx_t group_by_size = group_expressions ? group_expressions->size() : 0;
159737 for (idx_t set_idx = 0; set_idx < aggregate.children.size(); set_idx++) {
159738 grouping_set.insert(set_idx + group_by_size);
159739 }
159740 // Create the hashtable for the aggregate
159741 grouped_aggregate_data[table_idx] = make_uniq<GroupedAggregateData>();
159742 grouped_aggregate_data[table_idx]->InitializeDistinct(info.aggregates[i], group_expressions);
159743 radix_tables[table_idx] =
159744 make_uniq<RadixPartitionedHashTable>(grouping_set, *grouped_aggregate_data[table_idx], distinct_validity);
159745
159746 // Fill the chunk_types (only contains the payload of the distinct aggregates)
159747 vector<LogicalType> chunk_types;
159748 for (auto &child_p : aggregate.children) {
159749 chunk_types.push_back(child_p->return_type);
159750 }
159751 }
159752}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
vector< unique_ptr< GroupedAggregateData > > grouped_aggregate_data
The data used by the hashtables.
Definition duckdb.cpp:99205
vector< unique_ptr< RadixPartitionedHashTable > > radix_tables
The hashtables.
Definition duckdb.cpp:99207
vector< GroupingSet > grouping_sets
The groups (arguments).
Definition duckdb.cpp:99209

Member Function Documentation

◆ IsDistinct()

bool duckdb::DistinctAggregateData::IsDistinct ( idx_t index) const
159837 {
159838 bool is_distinct = !radix_tables.empty() && info.table_map.count(index);
159839#ifdef DEBUG
159842 bool found = false;
159843 for (auto &idx : info.indices) {
159844 if (idx == index) {
159845 found = true;
159846 break;
159847 }
159848 }
159849 D_ASSERT(found == is_distinct);
159850#endif
159851 return is_distinct;
159852}

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