Skip to content

Commit 52be833

Browse files
committed
fix aggregate all key is null error
1 parent 8ea193e commit 52be833

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Interpreters/Aggregator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,6 +2102,8 @@ Aggregator::convertToBlockImplNotFinal(Method & method, Table & data, Arenas & a
21022102
std::optional<OutputBlockColumns> out_cols;
21032103
std::optional<Sizes> shuffled_key_sizes;
21042104

2105+
size_t rows_in_current_block = 0;
2106+
21052107
auto init_out_cols = [&]()
21062108
{
21072109
out_cols = prepareOutputBlockColumns(params, aggregate_functions, getHeader(final), aggregates_pools, final, max_block_size);
@@ -2115,6 +2117,8 @@ Aggregator::convertToBlockImplNotFinal(Method & method, Table & data, Arenas & a
21152117
for (size_t i = 0; i < params.aggregates_size; ++i)
21162118
out_cols->aggregate_columns_data[i]->push_back(data.getNullKeyData() + offsets_of_aggregate_states[i]);
21172119

2120+
++rows_in_current_block;
2121+
21182122
data.getNullKeyData() = nullptr;
21192123
data.hasNullKeyData() = false;
21202124
}
@@ -2126,7 +2130,6 @@ Aggregator::convertToBlockImplNotFinal(Method & method, Table & data, Arenas & a
21262130
// should be invoked at least once, because null data might be the only content of the `data`
21272131
init_out_cols();
21282132

2129-
size_t rows_in_current_block = 0;
21302133

21312134
data.forEachValue(
21322135
[&](const auto & key, auto & mapped)

0 commit comments

Comments
 (0)