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 a77808e103 [Enhancement](function) optimize decimal minus and plus
#13320
a77808e103 is described below
commit a77808e1033b677b61c9fffba4730f2f61ddbb85
Author: Pxl <[email protected]>
AuthorDate: Thu Oct 13 09:00:05 2022 +0800
[Enhancement](function) optimize decimal minus and plus #13320
---
be/src/vec/functions/minus.cpp | 2 +-
be/src/vec/functions/plus.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/be/src/vec/functions/minus.cpp b/be/src/vec/functions/minus.cpp
index e282935729..947a1933d5 100644
--- a/be/src/vec/functions/minus.cpp
+++ b/be/src/vec/functions/minus.cpp
@@ -36,7 +36,7 @@ struct MinusImpl {
template <typename Result = DecimalV2Value>
static inline DecimalV2Value apply(DecimalV2Value a, DecimalV2Value b) {
- return a - b;
+ return DecimalV2Value(a.value() - b.value());
}
/// Apply operation and check overflow. It's used for Deciamal operations.
@returns true if overflowed, false otherwise.
diff --git a/be/src/vec/functions/plus.cpp b/be/src/vec/functions/plus.cpp
index d573d3a3d6..a020e66985 100644
--- a/be/src/vec/functions/plus.cpp
+++ b/be/src/vec/functions/plus.cpp
@@ -37,7 +37,7 @@ struct PlusImpl {
template <typename Result = DecimalV2Value>
static inline DecimalV2Value apply(DecimalV2Value a, DecimalV2Value b) {
- return a + b;
+ return DecimalV2Value(a.value() + b.value());
}
/// Apply operation and check overflow. It's used for Deciamal operations.
@returns true if overflowed, false otherwise.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]