HappenLee commented on code in PR #53560:
URL: https://github.com/apache/doris/pull/53560#discussion_r2221066967
##########
be/src/vec/aggregate_functions/aggregate_function_bitmap.h:
##########
@@ -348,26 +371,57 @@ class AggregateFunctionBitmapCount final
void add_many(AggregateDataPtr __restrict place, const IColumn** columns,
std::vector<int>& rows, Arena&) const override {
if constexpr (arg_is_nullable && std::is_same_v<ColVecType,
ColumnBitmap>) {
- auto& nullable_column = assert_cast<const
ColumnNullable&>(*columns[0]);
+ const auto& nullable_column = assert_cast<const
ColumnNullable&>(*columns[0]);
const auto& column =
assert_cast<const
ColVecType&>(nullable_column.get_nested_column());
std::vector<const BitmapValue*> values;
- for (int i = 0; i < rows.size(); ++i) {
- if (!nullable_column.is_null_at(rows[i])) {
- values.push_back(&(column.get_data()[rows[i]]));
+ for (auto row : rows) {
+ if (!nullable_column.is_null_at(row)) {
+ values.push_back(&(column.get_data()[row]));
}
}
this->data(place).add_batch(values);
} else if constexpr (std::is_same_v<ColVecType, ColumnBitmap>) {
const auto& column = assert_cast<const ColVecType&>(*columns[0]);
std::vector<const BitmapValue*> values;
- for (int i = 0; i < rows.size(); ++i) {
- values.push_back(&(column.get_data()[rows[i]]));
+ for (auto row : rows) {
+ values.push_back(&(column.get_data()[row]));
}
this->data(place).add_batch(values);
}
}
+ void add_batch_single_place(size_t batch_size, AggregateDataPtr place,
const IColumn** columns,
+ Arena& arena) const override {
Review Comment:
Add comment which func use the if constexpr to speed up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]