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 f72efd4523 [Improvement](decimal) do not log fatal when precision is 
invalid (#16207)
f72efd4523 is described below

commit f72efd45233c9a101751796430b57307bd6df22d
Author: Gabriel <[email protected]>
AuthorDate: Mon Jan 30 09:54:22 2023 +0800

    [Improvement](decimal) do not log fatal when precision is invalid (#16207)
---
 be/src/vec/data_types/data_type_decimal.cpp | 6 ++++--
 be/src/vec/exprs/vexpr.cpp                  | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/data_types/data_type_decimal.cpp 
b/be/src/vec/data_types/data_type_decimal.cpp
index aa1da12e4d..5d00e65033 100644
--- a/be/src/vec/data_types/data_type_decimal.cpp
+++ b/be/src/vec/data_types/data_type_decimal.cpp
@@ -163,11 +163,13 @@ T DataTypeDecimal<T>::parse_from_string(const 
std::string& str) const {
 DataTypePtr create_decimal(UInt64 precision_value, UInt64 scale_value, bool 
use_v2) {
     if (precision_value < min_decimal_precision() ||
         precision_value > max_decimal_precision<Decimal128>()) {
-        LOG(FATAL) << "Wrong precision " << precision_value;
+        LOG(WARNING) << "Wrong precision " << precision_value;
+        return nullptr;
     }
 
     if (static_cast<UInt64>(scale_value) > precision_value) {
-        LOG(FATAL) << "Negative scales and scales larger than precision are 
not supported";
+        LOG(WARNING) << "Negative scales and scales larger than precision are 
not supported";
+        return nullptr;
     }
 
     if (use_v2) {
diff --git a/be/src/vec/exprs/vexpr.cpp b/be/src/vec/exprs/vexpr.cpp
index db61504e29..dad8a33579 100644
--- a/be/src/vec/exprs/vexpr.cpp
+++ b/be/src/vec/exprs/vexpr.cpp
@@ -165,6 +165,9 @@ Status VExpr::create_expr(doris::ObjectPool* pool, const 
doris::TExprNode& texpr
     default:
         return Status::InternalError("Unknown expr node type: {}", 
texpr_node.node_type);
     }
+    if (!(*expr)->data_type()) {
+        return Status::InvalidArgument("Unknown expr type: {}", 
texpr_node.node_type);
+    }
     return Status::OK();
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to