MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / appendTuples

Method appendTuples

src/processor/operator/aggregate/simple_aggregate.cpp:123–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void SimpleAggregateSharedState::SimpleAggregatePartitioningData::appendTuples(
124 const FactorizedTable& factorizedTable, ft_col_offset_t hashOffset) {
125 DASSERT(sharedState->globalPartitions.size() > 0);
126 auto numBytesPerTuple = factorizedTable.getTableSchema()->getNumBytesPerTuple();
127 for (ft_tuple_idx_t tupleIdx = 0; tupleIdx < factorizedTable.getNumTuples(); tupleIdx++) {
128 auto tuple = factorizedTable.getTuple(tupleIdx);
129 auto hash = *reinterpret_cast<common::hash_t*>(tuple + hashOffset);
130 auto& partition =
131 sharedState->globalPartitions[(hash >> sharedState->shiftForPartitioning) %
132 sharedState->globalPartitions.size()];
133 partition.distinctTables[functionIdx].queue->appendTuple(
134 std::span(tuple, numBytesPerTuple));
135 }
136}
137
138// LCOV_EXCL_START
139void SimpleAggregateSharedState::SimpleAggregatePartitioningData::appendDistinctTuple(size_t,

Callers 1

mergeIfFullMethod · 0.45

Calls 6

appendTupleMethod · 0.80
sizeMethod · 0.45
getNumBytesPerTupleMethod · 0.45
getTableSchemaMethod · 0.45
getNumTuplesMethod · 0.45
getTupleMethod · 0.45

Tested by

no test coverage detected