diff --git a/be/src/vec/aggregate_functions/aggregate_function_count.h b/be/src/vec/aggregate_functions/aggregate_function_count.h index 8ab6b53e56..883a3b5c23 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count.h +++ b/be/src/vec/aggregate_functions/aggregate_function_count.h @@ -189,7 +189,11 @@ public: const size_t num_rows, Arena* arena) const override { auto& col = assert_cast(*dst); col.resize(num_rows); - col.get_data().assign(num_rows, 1UL); + auto& data = col.get_data(); + const ColumnNullable& input_col = assert_cast(*columns[0]); + for (size_t i = 0; i < num_rows; i++) { + data[i] = !input_col.is_null_at(i); + } } void deserialize_and_merge_from_column(AggregateDataPtr __restrict place, const IColumn& column,