This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1aeb16d153 [improvement](load) reduce useless err_msg format in
VOlapTableSink send (#9531)
1aeb16d153 is described below
commit 1aeb16d15383e95da5b5fa525c1bbfa9360bb036
Author: yixiutt <[email protected]>
AuthorDate: Sun May 29 16:02:57 2022 +0800
[improvement](load) reduce useless err_msg format in VOlapTableSink send
(#9531)
---
be/src/vec/sink/vtablet_sink.cpp | 43 ++++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 22 deletions(-)
diff --git a/be/src/vec/sink/vtablet_sink.cpp b/be/src/vec/sink/vtablet_sink.cpp
index bd048a3438..6129d9815e 100644
--- a/be/src/vec/sink/vtablet_sink.cpp
+++ b/be/src/vec/sink/vtablet_sink.cpp
@@ -491,26 +491,25 @@ Status VOlapTableSink::_validate_data(RuntimeState*
state, vectorized::Block* bl
if (!filter_bitmap->Get(j)) {
auto str_val = column_string->get_data_at(j);
bool invalid = str_val.size > limit;
-
- error_msg.clear();
- if (str_val.size > desc->type().len) {
- fmt::format_to(error_msg, "{}",
- "the length of input is too long than
schema. ");
- fmt::format_to(error_msg, "column_name: {}; ",
desc->col_name());
- fmt::format_to(error_msg, "input str: [{}] ",
str_val.to_prefix(10));
- fmt::format_to(error_msg, "schema length: {}; ",
desc->type().len);
- fmt::format_to(error_msg, "actual length: {}; ",
str_val.size);
- } else if (str_val.size > limit) {
- fmt::format_to(error_msg, "{}",
- "the length of input string is too long
than vec schema. ");
- fmt::format_to(error_msg, "column_name: {}; ",
desc->col_name());
- fmt::format_to(error_msg, "input str: [{}] ",
str_val.to_prefix(10));
- fmt::format_to(error_msg, "schema length: {}; ",
desc->type().len);
- fmt::format_to(error_msg, "limit length: {}; ", limit);
- fmt::format_to(error_msg, "actual length: {}; ",
str_val.size);
- }
-
if (invalid) {
+ error_msg.clear();
+ if (str_val.size > desc->type().len) {
+ fmt::format_to(error_msg, "{}",
+ "the length of input is too long
than schema. ");
+ fmt::format_to(error_msg, "column_name: {}; ",
desc->col_name());
+ fmt::format_to(error_msg, "input str: [{}] ",
str_val.to_prefix(10));
+ fmt::format_to(error_msg, "schema length: {}; ",
desc->type().len);
+ fmt::format_to(error_msg, "actual length: {}; ",
str_val.size);
+ } else if (str_val.size > limit) {
+ fmt::format_to(
+ error_msg, "{}",
+ "the length of input string is too long
than vec schema. ");
+ fmt::format_to(error_msg, "column_name: {}; ",
desc->col_name());
+ fmt::format_to(error_msg, "input str: [{}] ",
str_val.to_prefix(10));
+ fmt::format_to(error_msg, "schema length: {}; ",
desc->type().len);
+ fmt::format_to(error_msg, "limit length: {}; ",
limit);
+ fmt::format_to(error_msg, "actual length: {}; ",
str_val.size);
+ }
RETURN_IF_ERROR(set_invalid_and_append_error_msg(j));
}
}
@@ -568,10 +567,10 @@ Status VOlapTableSink::_validate_data(RuntimeState*
state, vectorized::Block* bl
if ((!desc->is_nullable() || desc->type() == TYPE_OBJECT) &&
column_ptr) {
const auto& null_map = column_ptr->get_null_map_data();
for (int j = 0; j < null_map.size(); ++j) {
- fmt::format_to(error_msg,
- "null value for not null column/or bitmap
column, column={}; ",
- desc->col_name());
if (null_map[j] && !filter_bitmap->Get(j)) {
+ error_msg.clear();
+ fmt::format_to(error_msg, "null value for not null column,
column={}; ",
+ desc->col_name());
RETURN_IF_ERROR(set_invalid_and_append_error_msg(j));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]