BiteTheDDDDt commented on code in PR #52837:
URL: https://github.com/apache/doris/pull/52837#discussion_r2200529776
##########
be/src/vec/functions/minus.cpp:
##########
@@ -53,12 +59,650 @@ struct MinusImpl {
}
};
-struct NameMinus {
+template <PrimitiveType Type>
+struct MinusIntegralImpl {
+ static constexpr bool result_is_decimal = false;
+ using Arg = typename PrimitiveTypeTraits<Type>::ColumnItemType;
+ using ColumnType = typename PrimitiveTypeTraits<Type>::ColumnType;
+ using ArgA = Arg;
+ using ArgB = Arg;
+ using DataTypeA = typename PrimitiveTypeTraits<Type>::DataType;
+ using DataTypeB = typename PrimitiveTypeTraits<Type>::DataType;
+ static constexpr PrimitiveType ResultType = Type;
+
+ static DataTypes get_variadic_argument_types() {
+ return {std::make_shared<typename
PrimitiveTypeTraits<Type>::DataType>(),
+ std::make_shared<typename
PrimitiveTypeTraits<Type>::DataType>()};
+ }
+
+ static inline typename PrimitiveTypeTraits<Type>::CppNativeType apply(Arg
a, Arg b) {
+ return a - b;
+ }
+
+ /// Apply operation and check overflow. It's used for Decimal operations.
@returns true if overflowed, false otherwise.
+ static inline bool apply(Arg a, Arg b, typename
PrimitiveTypeTraits<Type>::CppNativeType& c) {
+ return common::sub_overflow(a, b, c);
Review Comment:
这个三参数apply在IntegralImpl里是不是没用到
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]