| 562 | } |
| 563 | |
| 564 | void AggregateHashTable::appendDistinct(const std::vector<ValueVector*>& keyVectors, |
| 565 | ValueVector* aggregateVector, const DataChunkState* leadingState) { |
| 566 | std::vector<ValueVector*> distinctKeyVectors(keyVectors); |
| 567 | distinctKeyVectors.push_back(aggregateVector); |
| 568 | // The aggregateVector's state is either the same as the leading state (doesn't matter which we |
| 569 | // use), flat (where we must pass the original leading state), or unflat while the leadingState |
| 570 | // is flat (where we must pass the aggregateVector's state) |
| 571 | auto distinctLeadingState = |
| 572 | aggregateVector->state->isFlat() ? leadingState : aggregateVector->state.get(); |
| 573 | append(distinctKeyVectors, distinctLeadingState, std::vector<AggregateInput>{}, |
| 574 | 1 /*multiplicity*/); |
| 575 | } |
| 576 | |
| 577 | void AggregateHashTable::updateAggState(const std::vector<ValueVector*>& keyVectors, |
| 578 | AggregateFunction& aggregateFunction, ValueVector* aggVector, uint64_t multiplicity, |
no test coverage detected