This is an automated email from the ASF dual-hosted git repository.
zclll pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 18cbbc9eafd [chore](errmsg) fix wrong usage of InternalError in
quantile_percent (#55224)
18cbbc9eafd is described below
commit 18cbbc9eafdb11d1932c6f1c2999999b595af56a
Author: zclllyybb <[email protected]>
AuthorDate: Mon Aug 25 15:58:05 2025 +0800
[chore](errmsg) fix wrong usage of InternalError in quantile_percent
(#55224)
for inputs that are ineligible, should use invalid_argument rather than
internal_error
---
be/src/vec/functions/function_quantile_state.cpp | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/be/src/vec/functions/function_quantile_state.cpp
b/be/src/vec/functions/function_quantile_state.cpp
index bde7de92227..63460255fdc 100644
--- a/be/src/vec/functions/function_quantile_state.cpp
+++ b/be/src/vec/functions/function_quantile_state.cpp
@@ -20,13 +20,10 @@
#include <fmt/format.h>
#include <glog/logging.h>
-#include <stddef.h>
-#include <algorithm>
#include <boost/iterator/iterator_facade.hpp>
+#include <cstddef>
#include <memory>
-#include <ostream>
-#include <string>
#include <utility>
#include "common/compiler_util.h" // IWYU pragma: keep
@@ -117,7 +114,7 @@ public:
continue;
}
}
- double value = (double)col->get_data()[i];
+ auto value = (double)col->get_data()[i];
res_data[i].set_compression(compression);
res_data[i].add_value(value);
}
@@ -128,7 +125,7 @@ public:
uint32_t result, size_t input_rows_count) const
override {
const ColumnPtr& column = block.get_by_position(arguments[0]).column;
const DataTypePtr& data_type =
block.get_by_position(arguments[0]).type;
- auto compression_arg = check_and_get_column_const<ColumnFloat32>(
+ const auto* compression_arg =
check_and_get_column_const<ColumnFloat32>(
block.get_by_position(arguments.back()).column.get());
float compression = 2048;
if (compression_arg) {
@@ -177,22 +174,22 @@ public:
auto& null_map = data_null_map->get_data();
auto column =
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
- if (auto* nullable = check_and_get_column<const
ColumnNullable>(*column)) {
+ if (const auto* nullable = check_and_get_column<const
ColumnNullable>(*column)) {
VectorizedUtils::update_null_map(null_map,
nullable->get_null_map_data());
column = nullable->get_nested_column_ptr();
}
- auto str_col = assert_cast<const ColumnQuantileState*>(column.get());
- auto& col_data = str_col->get_data();
- auto percent_arg = check_and_get_column_const<ColumnFloat32>(
+ const auto* str_col = assert_cast<const
ColumnQuantileState*>(column.get());
+ const auto& col_data = str_col->get_data();
+ const auto* percent_arg = check_and_get_column_const<ColumnFloat32>(
block.get_by_position(arguments.back()).column.get());
if (!percent_arg) {
- return Status::InternalError(
+ return Status::InvalidArgument(
"Second argument to {} must be a constant float describing
type", get_name());
}
- float percent_arg_value = percent_arg->get_value<Float32>();
+ auto percent_arg_value = percent_arg->get_value<Float32>();
if (percent_arg_value < 0 || percent_arg_value > 1) {
- return Status::InternalError(
+ return Status::InvalidArgument(
"the input argument of percentage: {} is not valid, must
be in range [0,1] ",
percent_arg_value);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]