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::RowOperations Struct Reference

Static Public Member Functions

static void InitializeStates (TupleDataLayout &layout, Vector &addresses, const SelectionVector &sel, idx_t count)
 initialize - unaligned addresses
static void DestroyStates (RowOperationsState &state, TupleDataLayout &layout, Vector &addresses, idx_t count)
 destructor - unaligned addresses, updated
static void UpdateStates (RowOperationsState &state, AggregateObject &aggr, Vector &addresses, DataChunk &payload, idx_t arg_idx, idx_t count)
 update - aligned addresses
static void UpdateFilteredStates (RowOperationsState &state, AggregateFilterData &filter_data, AggregateObject &aggr, Vector &addresses, DataChunk &payload, idx_t arg_idx)
 filtered update - aligned addresses
static void CombineStates (RowOperationsState &state, TupleDataLayout &layout, Vector &sources, Vector &targets, idx_t count)
 combine - unaligned addresses, updated
static void FinalizeStates (RowOperationsState &state, TupleDataLayout &layout, Vector &addresses, DataChunk &result, idx_t aggr_idx)
 finalize - unaligned addresses, updated

Member Function Documentation

◆ InitializeStates()

void duckdb::RowOperations::InitializeStates ( TupleDataLayout & layout,
Vector & addresses,
const SelectionVector & sel,
idx_t count )
static

initialize - unaligned addresses

99775 {
99776 if (count == 0) {
99777 return;
99778 }
99779 auto pointers = FlatVector::GetData<data_ptr_t>(addresses);
99780 auto &offsets = layout.GetOffsets();
99781 auto aggr_idx = layout.ColumnCount();
99782
99783 for (const auto &aggr : layout.GetAggregates()) {
99784 if (sel.IsSet()) {
99785 for (idx_t i = 0; i < count; ++i) {
99786 aggr.function.GetStateInitCallback()(aggr.function,
99787 pointers[sel.get_index_unsafe(i)] + offsets[aggr_idx]);
99788 }
99789 } else {
99790 for (idx_t i = 0; i < count; ++i) {
99791 aggr.function.GetStateInitCallback()(aggr.function, pointers[i] + offsets[aggr_idx]);
99792 }
99793 }
99794 ++aggr_idx;
99795 }
99796}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DestroyStates()

void duckdb::RowOperations::DestroyStates ( RowOperationsState & state,
TupleDataLayout & layout,
Vector & addresses,
idx_t count )
static

destructor - unaligned addresses, updated

99798 {
99799 if (count == 0) {
99800 return;
99801 }
99802 // Move to the first aggregate state
99803 VectorOperations::AddInPlace(addresses, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
99804 for (const auto &aggr : layout.GetAggregates()) {
99805 if (aggr.function.HasStateDestructorCallback()) {
99806 AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator);
99807 aggr.function.GetStateDestructorCallback()(addresses, aggr_input_data, count);
99808 }
99809 // Move to the next aggregate state
99810 VectorOperations::AddInPlace(addresses, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
99811 }
99812}
static void AddInPlace(Vector &left, int64_t delta, idx_t count)
left += delta
Definition duckdb.cpp:143413
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateStates()

void duckdb::RowOperations::UpdateStates ( RowOperationsState & state,
AggregateObject & aggr,
Vector & addresses,
DataChunk & payload,
idx_t arg_idx,
idx_t count )
static

update - aligned addresses

99815 {
99816 AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator);
99817 aggr.function.GetStateUpdateCallback()(aggr.child_count == 0 ? nullptr : &payload.data[arg_idx], aggr_input_data,
99818 aggr.child_count, addresses, count);
99819}
vector< Vector > data
The vectors owned by the DataChunk.
Definition duckdb.hpp:11445
Here is the caller graph for this function:

◆ UpdateFilteredStates()

void duckdb::RowOperations::UpdateFilteredStates ( RowOperationsState & state,
AggregateFilterData & filter_data,
AggregateObject & aggr,
Vector & addresses,
DataChunk & payload,
idx_t arg_idx )
static

filtered update - aligned addresses

99822 {
99823 idx_t count = filter_data.ApplyFilter(payload);
99824 if (count == 0) {
99825 return;
99826 }
99827
99828 Vector filtered_addresses(addresses, filter_data.true_sel, count);
99829 filtered_addresses.Flatten(count);
99830
99831 UpdateStates(state, aggr, filtered_addresses, filter_data.filtered_payload, arg_idx, count);
99832}
static void UpdateStates(RowOperationsState &state, AggregateObject &aggr, Vector &addresses, DataChunk &payload, idx_t arg_idx, idx_t count)
update - aligned addresses
Definition duckdb.cpp:99814
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CombineStates()

void duckdb::RowOperations::CombineStates ( RowOperationsState & state,
TupleDataLayout & layout,
Vector & sources,
Vector & targets,
idx_t count )
static

combine - unaligned addresses, updated

99835 {
99836 if (count == 0) {
99837 return;
99838 }
99839
99840 // Move to the first aggregate states
99841 VectorOperations::AddInPlace(sources, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
99842 VectorOperations::AddInPlace(targets, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
99843
99844 // Keep track of the offset
99845 idx_t offset = layout.GetAggrOffset();
99846
99847 for (auto &aggr : layout.GetAggregates()) {
99848 D_ASSERT(aggr.function.HasStateCombineCallback());
99849 AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator,
99850 AggregateCombineType::ALLOW_DESTRUCTIVE);
99851 aggr.function.GetStateCombineCallback()(sources, targets, aggr_input_data, count);
99852
99853 // Move to the next aggregate states
99854 VectorOperations::AddInPlace(sources, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
99855 VectorOperations::AddInPlace(targets, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
99856
99857 // Increment the offset
99858 offset += aggr.payload_size;
99859 }
99860
99861 // Now subtract the offset to get back to the original position
99862 VectorOperations::AddInPlace(sources, -UnsafeNumericCast<int64_t>(offset), count);
99863 VectorOperations::AddInPlace(targets, -UnsafeNumericCast<int64_t>(offset), count);
99864}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinalizeStates()

void duckdb::RowOperations::FinalizeStates ( RowOperationsState & state,
TupleDataLayout & layout,
Vector & addresses,
DataChunk & result,
idx_t aggr_idx )
static

finalize - unaligned addresses, updated

99867 {
99868 // Copy the addresses
99869 if (!state.addresses) {
99870 state.addresses = make_uniq<Vector>(LogicalType::POINTER);
99871 }
99872 auto &addresses_copy = *state.addresses;
99873 VectorOperations::Copy(addresses, addresses_copy, result.size(), 0, 0);
99874
99875 // Move to the first aggregate state
99876 VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), result.size());
99877
99878 auto &aggregates = layout.GetAggregates();
99879 for (idx_t i = 0; i < aggregates.size(); i++) {
99880 auto &target = result.data[aggr_idx + i];
99881 auto &aggr = aggregates[i];
99882 AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator);
99883 aggr.function.GetStateFinalizeCallback()(addresses_copy, aggr_input_data, target, result.size(), 0);
99884
99885 // Move to the next aggregate state
99886 VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast<int64_t>(aggr.payload_size), result.size());
99887 }
99888}
Here is the call graph for this function:
Here is the caller graph for this function:

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