Fix comments

This commit is contained in:
avogar 2022-09-16 16:12:30 +00:00
parent 92979af3bf
commit c9a9ef5b7e
3 changed files with 6 additions and 4 deletions

View File

@ -145,7 +145,7 @@ public:
return nested_func->getDefaultVersion();
}
template <bool up_tp_state>
template <bool up_to_state>
void destroyImpl(AggregateDataPtr __restrict place) const noexcept
{
AggregateFunctionForEachData & state = data(place);
@ -153,7 +153,7 @@ public:
char * nested_state = state.array_of_aggregate_datas;
for (size_t i = 0; i < state.dynamic_array_size; ++i)
{
if constexpr (up_tp_state)
if constexpr (up_to_state)
nested_func->destroyUpToState(nested_state);
else
nested_func->destroy(nested_state);

View File

@ -225,8 +225,7 @@ public:
nested_func->destroy(nested_place);
}
auto to_destroy = std::move(state.merged_maps);
this->data(place).~Data();
state.~Data();
}
void destroy(AggregateDataPtr __restrict place) const noexcept override

View File

@ -1756,6 +1756,9 @@ inline void Aggregator::insertAggregatesIntoColumns(Mapped & mapped, MutableColu
* and ColumnAggregateFunction will take ownership of this state.
* So, for aggregate functions with "-State" modifier, only states of all combinators that are used
* after -State will be destroyed after result has been transferred to ColumnAggregateFunction.
* For example, if we have function `uniqStateForEachMap` after aggregation we should destroy all states that
* were created by combinators `-ForEach` and `-Map`, because resulting ColumnAggregateFunction will be
* responsible only for destruction of the states created by `uniq` function.
* But we should mark that the data no longer owns these states.
*/