You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/12/14 03:35:45 UTC
[doris] 03/03: [minor](decimal) degrade log level for overflow decimal (#14748)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 2623ae88f7caa2ce4a616fb29d9dacca2c853403
Author: Gabriel <ga...@gmail.com>
AuthorDate: Fri Dec 2 15:55:26 2022 +0800
[minor](decimal) degrade log level for overflow decimal (#14748)
---
be/src/vec/data_types/data_type_decimal.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/be/src/vec/data_types/data_type_decimal.h b/be/src/vec/data_types/data_type_decimal.h
index 1ccce064cf..ea29954293 100644
--- a/be/src/vec/data_types/data_type_decimal.h
+++ b/be/src/vec/data_types/data_type_decimal.h
@@ -336,7 +336,7 @@ convert_decimals(const typename FromDataType::FieldType& value, UInt32 scale_fro
DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
if (common::mul_overflow(static_cast<MaxNativeType>(value), converted_value,
converted_value)) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return converted_value < 0
? std::numeric_limits<typename ToFieldType::NativeType>::min()
: std::numeric_limits<typename ToFieldType::NativeType>::max();
@@ -348,11 +348,11 @@ convert_decimals(const typename FromDataType::FieldType& value, UInt32 scale_fro
if constexpr (sizeof(FromFieldType) > sizeof(ToFieldType)) {
if (converted_value < std::numeric_limits<typename ToFieldType::NativeType>::min()) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return std::numeric_limits<typename ToFieldType::NativeType>::min();
}
if (converted_value > std::numeric_limits<typename ToFieldType::NativeType>::max()) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return std::numeric_limits<typename ToFieldType::NativeType>::max();
}
}
@@ -381,11 +381,11 @@ convert_from_decimal(const typename FromDataType::FieldType& value, UInt32 scale
!std::numeric_limits<ToFieldType>::is_signed) {
if constexpr (std::numeric_limits<ToFieldType>::is_signed) {
if (converted_value < std::numeric_limits<ToFieldType>::min()) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return std::numeric_limits<ToFieldType>::min();
}
if (converted_value > std::numeric_limits<ToFieldType>::max()) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return std::numeric_limits<ToFieldType>::max();
}
} else {
@@ -395,7 +395,7 @@ convert_from_decimal(const typename FromDataType::FieldType& value, UInt32 scale
if (converted_value < 0 ||
converted_value >
static_cast<CastIntType>(std::numeric_limits<ToFieldType>::max())) {
- LOG(WARNING) << "Decimal convert overflow";
+ VLOG_DEBUG << "Decimal convert overflow";
return std::numeric_limits<ToFieldType>::max();
}
}
@@ -413,7 +413,7 @@ convert_to_decimal(const typename FromDataType::FieldType& value, UInt32 scale)
if constexpr (std::is_floating_point_v<FromFieldType>) {
if (!std::isfinite(value)) {
- LOG(WARNING) << "Decimal convert overflow. Cannot convert infinity or NaN to decimal";
+ VLOG_DEBUG << "Decimal convert overflow. Cannot convert infinity or NaN to decimal";
return value < 0 ? std::numeric_limits<ToNativeType>::min()
: std::numeric_limits<ToNativeType>::max();
}
@@ -421,11 +421,11 @@ convert_to_decimal(const typename FromDataType::FieldType& value, UInt32 scale)
FromFieldType out;
out = value * ToDataType::get_scale_multiplier(scale);
if (out <= static_cast<FromFieldType>(std::numeric_limits<ToNativeType>::min())) {
- LOG(WARNING) << "Decimal convert overflow. Float is out of Decimal range";
+ VLOG_DEBUG << "Decimal convert overflow. Float is out of Decimal range";
return std::numeric_limits<ToNativeType>::min();
}
if (out >= static_cast<FromFieldType>(std::numeric_limits<ToNativeType>::max())) {
- LOG(WARNING) << "Decimal convert overflow. Float is out of Decimal range";
+ VLOG_DEBUG << "Decimal convert overflow. Float is out of Decimal range";
return std::numeric_limits<ToNativeType>::max();
}
return out;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org