This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 1901f0f35b1 [fix](function) bad performance caused by creating
Status::RuntimeError (#28362)
1901f0f35b1 is described below
commit 1901f0f35b1647672f16b5fb682c143be9c61e7f
Author: Jerry Hu <[email protected]>
AuthorDate: Thu Dec 14 09:29:22 2023 +0800
[fix](function) bad performance caused by creating Status::RuntimeError
(#28362)
---
be/src/vec/functions/function_binary_arithmetic.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/be/src/vec/functions/function_binary_arithmetic.h
b/be/src/vec/functions/function_binary_arithmetic.h
index a58417b71e2..1cc67804ec7 100644
--- a/be/src/vec/functions/function_binary_arithmetic.h
+++ b/be/src/vec/functions/function_binary_arithmetic.h
@@ -961,8 +961,7 @@ public:
}
bool check_overflow_for_decimal =
context->check_overflow_for_decimal();
- auto status = Status::RuntimeError("{}'s arguments do not match the
expected data types",
- get_name());
+ Status status;
bool valid = cast_both_types(
left_generic, right_generic, result_generic,
[&](const auto& left, const auto& right, const auto& res) {
@@ -1016,6 +1015,10 @@ public:
return false;
});
if (!valid) {
+ if (status.ok()) {
+ return Status::RuntimeError("{}'s arguments do not match the
expected data types",
+ get_name());
+ }
return status;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]