[fix](agg)count function should return 0 for null value (#13247)
count(null) should return 0 instead of 1, the streaming_agg_serialize_to_column function didn't handle if the input value is null, this pr fix it.
This commit is contained in:
@ -189,7 +189,11 @@ public:
|
||||
const size_t num_rows, Arena* arena) const override {
|
||||
auto& col = assert_cast<ColumnUInt64&>(*dst);
|
||||
col.resize(num_rows);
|
||||
col.get_data().assign(num_rows, 1UL);
|
||||
auto& data = col.get_data();
|
||||
const ColumnNullable& input_col = assert_cast<const ColumnNullable&>(*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,
|
||||
|
||||
Reference in New Issue
Block a user