zhiqiang-hhhh commented on code in PR #38608:
URL: https://github.com/apache/doris/pull/38608#discussion_r1698550688
##########
be/src/vec/aggregate_functions/aggregate_function_histogram.h:
##########
@@ -186,13 +198,18 @@ class AggregateFunctionHistogram final
void add(AggregateDataPtr __restrict place, const IColumn** columns,
ssize_t row_num,
Arena* arena) const override {
- if (columns[0]->is_null_at(row_num)) {
- return;
- }
-
- if (has_input_param) {
+ if constexpr (has_input_param) {
+ Int32 input_max_num_buckets =
+ assert_cast<const
ColumnInt32*>(columns[1])->get_element(row_num);
+ if (input_max_num_buckets <= 0) {
+ throw doris::Exception(ErrorCode::INVALID_ARGUMENT,
+ "Invalid max_num_buckets {}, row_num
{}",
+ input_max_num_buckets, row_num);
+ }
this->data(place).set_parameters(
assert_cast<const
ColumnInt32*>(columns[1])->get_element(row_num));
Review Comment:
yes
--
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]