Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
  • Loading branch information
windtalker committed Sep 13, 2023
1 parent b415837 commit 80dc190
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions dbms/src/Interpreters/Aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ size_t AggregatedDataVariants::getBucketNumberForTwoLevelHashTable(Type type)
}
}

void AggregatedDataVariants::setResizeCallbackIfNeeded(size_t thread_num)
void AggregatedDataVariants::setResizeCallbackIfNeeded(size_t thread_num) const
{
if (aggregator)
{
Expand Down Expand Up @@ -672,21 +672,19 @@ ALWAYS_INLINE void Aggregator::executeImplBatch(
{
/// For all rows.
AggregateDataPtr place = aggregates_pool->alloc(0);
size_t processed_rows = std::numeric_limits<size_t>::max();
try
{
for (size_t i = agg_process_info.start_row; i < agg_process_info.start_row + agg_size; ++i)
for (size_t i = 0; i < agg_size; ++i)
{
state.emplaceKey(method.data, i, *aggregates_pool, sort_key_containers).setMapped(place);
processed_rows = i;
state.emplaceKey(method.data, agg_process_info.start_row, *aggregates_pool, sort_key_containers)
.setMapped(place);
++agg_process_info.start_row;
}
}
catch (ResizeException &)
{
LOG_INFO(log, "HashTable resize throw ResizeException since the data is already marked for spill");
}
if (processed_rows != std::numeric_limits<size_t>::max())
agg_process_info.start_row = processed_rows + 1;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Interpreters/Aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ struct AggregatedDataVariants : private boost::noncopyable

void convertToTwoLevel();

void setResizeCallbackIfNeeded(size_t thread_num);
void setResizeCallbackIfNeeded(size_t thread_num) const;

#define APPLY_FOR_VARIANTS_TWO_LEVEL(M) \
M(key32_two_level) \
Expand Down

0 comments on commit 80dc190

Please sign in to comment.