This is an automated email from the ASF dual-hosted git repository.
zhangstar333 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 120916eaeb5 [chore](log) Use correct error type of uneven user
behaviour (#43334)
120916eaeb5 is described below
commit 120916eaeb52c77c6a15abb6a36ecb212d3048f8
Author: zclllhhjj <[email protected]>
AuthorDate: Fri Nov 8 14:26:05 2024 +0800
[chore](log) Use correct error type of uneven user behaviour (#43334)
### What problem does this PR solve?
Problem Summary:
Before we use `INTERNAL_ERROR` when array is oversize. It will print
stacktrace. Actually internal error always means there's bug in our
code. So this is misuse. I changed them all in this PR to
`INVALID_ARGUMENT`.
---
be/src/vec/columns/column_array.cpp | 5 +++--
be/src/vec/columns/column_map.cpp | 2 +-
be/src/vec/functions/array/function_array_with_constant.cpp | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/be/src/vec/columns/column_array.cpp
b/be/src/vec/columns/column_array.cpp
index b1ecf847583..ca1f49a67f0 100644
--- a/be/src/vec/columns/column_array.cpp
+++ b/be/src/vec/columns/column_array.cpp
@@ -25,6 +25,7 @@
#include <cstring>
#include <vector>
+#include "common/status.h"
#include "vec/columns/column_const.h"
#include "vec/columns/column_nullable.h"
#include "vec/columns/column_string.h"
@@ -130,7 +131,7 @@ Field ColumnArray::operator[](size_t n) const {
if (size > max_array_size_as_field)
throw doris::Exception(
- ErrorCode::INTERNAL_ERROR,
+ ErrorCode::INVALID_ARGUMENT,
"Array of size {}, is too large to be manipulated as single
field, maximum size {}",
size, max_array_size_as_field);
@@ -147,7 +148,7 @@ void ColumnArray::get(size_t n, Field& res) const {
if (size > max_array_size_as_field)
throw doris::Exception(
- ErrorCode::INTERNAL_ERROR,
+ ErrorCode::INVALID_ARGUMENT,
"Array of size {}, is too large to be manipulated as single
field, maximum size {}",
size, max_array_size_as_field);
diff --git a/be/src/vec/columns/column_map.cpp
b/be/src/vec/columns/column_map.cpp
index 7550803dac2..85964ca967b 100644
--- a/be/src/vec/columns/column_map.cpp
+++ b/be/src/vec/columns/column_map.cpp
@@ -105,7 +105,7 @@ Field ColumnMap::operator[](size_t n) const {
size_t element_size = size_at(n);
if (element_size > max_array_size_as_field) {
- throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR,
+ throw doris::Exception(doris::ErrorCode::INVALID_ARGUMENT,
"element size {} is too large to be manipulated
as single map "
"field, maximum size {}",
element_size, max_array_size_as_field);
diff --git a/be/src/vec/functions/array/function_array_with_constant.cpp
b/be/src/vec/functions/array/function_array_with_constant.cpp
index 6f38e83e209..ba385535ebb 100644
--- a/be/src/vec/functions/array/function_array_with_constant.cpp
+++ b/be/src/vec/functions/array/function_array_with_constant.cpp
@@ -92,8 +92,8 @@ public:
for (size_t i = 0; i < input_rows_count; ++i) {
auto array_size = num->get_int(i);
if (UNLIKELY(array_size < 0) || UNLIKELY(array_size >
max_array_size_as_field)) {
- return Status::RuntimeError("Array size should in range(0, {})
in function: {}",
- max_array_size_as_field,
get_name());
+ return Status::InvalidArgument("Array size should in range(0,
{}) in function: {}",
+ max_array_size_as_field,
get_name());
}
offset += array_size;
offsets.push_back(offset);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]