| 121 | } |
| 122 | |
| 123 | void 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 |
| 139 | void SimpleAggregateSharedState::SimpleAggregatePartitioningData::appendDistinctTuple(size_t, |
no test coverage detected