HappenLee commented on code in PR #43777:
URL: https://github.com/apache/doris/pull/43777#discussion_r1839350217
##########
be/src/vec/aggregate_functions/aggregate_function_covar.h:
##########
@@ -179,35 +158,7 @@ class AggregateFunctionSampCovariance
if constexpr (is_pop) {
this->data(place).add(columns[0], columns[1], row_num);
} else {
- if constexpr (is_nullable) { //this if check could remove with old
function
- // nullable means at least one child is null.
- // so here, maybe JUST ONE OF ups is null. so nullptr perhaps
in ..._x or ..._y!
- const auto* nullable_column_x =
check_and_get_column<ColumnNullable>(columns[0]);
- const auto* nullable_column_y =
check_and_get_column<ColumnNullable>(columns[1]);
-
- if (nullable_column_x && nullable_column_y) { // both nullable
- if (!nullable_column_x->is_null_at(row_num) &&
- !nullable_column_y->is_null_at(row_num)) {
-
this->data(place).add(&nullable_column_x->get_nested_column(),
-
&nullable_column_y->get_nested_column(), row_num);
- }
- } else if (nullable_column_x) { // x nullable
- if (!nullable_column_x->is_null_at(row_num)) {
-
this->data(place).add(&nullable_column_x->get_nested_column(), columns[1],
- row_num);
- }
- } else if (nullable_column_y) { // y nullable
- if (!nullable_column_y->is_null_at(row_num)) {
- this->data(place).add(columns[0],
&nullable_column_y->get_nested_column(),
- row_num);
- }
- } else {
- throw Exception(ErrorCode::INTERNAL_ERROR,
- "Nullable function {} get non-nullable
columns!", get_name());
- }
- } else {
- this->data(place).add(columns[0], columns[1], row_num);
- }
+ this->data(place).add(columns[0], columns[1], row_num);
Review Comment:
same as line 159, why need if?
--
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]