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::HashedSortLocalSinkState Class Reference
Inheritance diagram for duckdb::HashedSortLocalSinkState:
Collaboration diagram for duckdb::HashedSortLocalSinkState:

Public Types

using LocalSortStatePtr = unique_ptr<LocalSinkState>
using GroupingPartition = unique_ptr<RadixPartitionedTupleData>
using GroupingAppend = unique_ptr<PartitionedTupleDataAppendState>

Public Member Functions

 HashedSortLocalSinkState (ExecutionContext &context, const HashedSort &hashed_sort)
void Hash (DataChunk &input_chunk, Vector &hash_vector)
 Compute the hash values.
void Combine (ExecutionContext &context)
 Merge the state into the global state.
Public Member Functions inherited from duckdb::LocalSinkState
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

const HashedSort & hashed_sort
 Global state.
Allocator & allocator
ExpressionExecutor hash_exec
 Shared expression evaluation.
ExpressionExecutor sort_exec
DataChunk group_chunk
DataChunk sort_chunk
DataChunk payload_chunk
GroupingPartition local_grouping
GroupingAppend grouping_append
Public Attributes inherited from duckdb::LocalSinkState
SourcePartitionInfo partition_info
 Source partition info.

Constructor & Destructor Documentation

◆ HashedSortLocalSinkState()

duckdb::HashedSortLocalSinkState::HashedSortLocalSinkState ( ExecutionContext & context,
const HashedSort & hashed_sort )
102096 : hashed_sort(hashed_sort), allocator(Allocator::Get(context.client)), hash_exec(context.client),
102097 sort_exec(context.client) {
102098 vector<LogicalType> group_types;
102099 for (idx_t prt_idx = 0; prt_idx < hashed_sort.partitions.size(); prt_idx++) {
102100 auto &pexpr = *hashed_sort.partitions[prt_idx].expression.get();
102101 group_types.push_back(pexpr.return_type);
102102 hash_exec.AddExpression(pexpr);
102103 }
102104
102105 vector<LogicalType> sort_types;
102106 for (const auto &expr : hashed_sort.sort_exprs) {
102107 sort_types.emplace_back(expr->return_type);
102108 sort_exec.AddExpression(*expr);
102109 }
102110 sort_chunk.Initialize(context.client, sort_types);
102111
102112 auto hash_types = hashed_sort.payload_types;
102113 group_chunk.Initialize(allocator, group_types);
102114 hash_types.emplace_back(LogicalType::HASH);
102115 payload_chunk.Initialize(allocator, hash_types);
102116}
ExpressionExecutor hash_exec
Shared expression evaluation.
Definition duckdb.cpp:102079
const HashedSort & hashed_sort
Global state.
Definition duckdb.cpp:102075
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

Member Function Documentation

◆ Hash()

void duckdb::HashedSortLocalSinkState::Hash ( DataChunk & input_chunk,
Vector & hash_vector )

Compute the hash values.

102124 {
102125 const auto count = input_chunk.size();
102126 D_ASSERT(group_chunk.ColumnCount() > 0);
102127
102128 // OVER(PARTITION BY...) (hash grouping)
102129 group_chunk.Reset();
102130 hash_exec.Execute(input_chunk, group_chunk);
102131 VectorOperations::Hash(group_chunk.data[0], hash_vector, count);
102132 for (idx_t prt_idx = 1; prt_idx < group_chunk.ColumnCount(); ++prt_idx) {
102133 VectorOperations::CombineHash(hash_vector, group_chunk.data[prt_idx], count);
102134 }
102135}

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