quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hakanmemiso...@apache.org
Subject incubator-quickstep git commit: New changes.
Date Tue, 14 Jun 2016 15:10:46 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/decimal-type 06dce00d4 -> 5ae24b71f


New changes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/5ae24b71
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/5ae24b71
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/5ae24b71

Branch: refs/heads/decimal-type
Commit: 5ae24b71f2feaae1addb43463e2150202e4db4cf
Parents: 06dce00
Author: Hakan Memisoglu <hakanmemisoglu@apache.org>
Authored: Tue Jun 14 10:09:25 2016 -0500
Committer: Hakan Memisoglu <hakanmemisoglu@apache.org>
Committed: Tue Jun 14 10:09:25 2016 -0500

----------------------------------------------------------------------
 .../unary_operations/ArithmeticUnaryOperations.cpp     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/5ae24b71/types/operations/unary_operations/ArithmeticUnaryOperations.cpp
----------------------------------------------------------------------
diff --git a/types/operations/unary_operations/ArithmeticUnaryOperations.cpp b/types/operations/unary_operations/ArithmeticUnaryOperations.cpp
index 1e61db3..003c17e 100644
--- a/types/operations/unary_operations/ArithmeticUnaryOperations.cpp
+++ b/types/operations/unary_operations/ArithmeticUnaryOperations.cpp
@@ -20,6 +20,7 @@
 #include <string>
 
 #include "types/DatetimeIntervalType.hpp"
+#include "types/DecimalType.hpp"
 #include "types/DoubleType.hpp"
 #include "types/FloatType.hpp"
 #include "types/IntType.hpp"
@@ -40,7 +41,7 @@ namespace quickstep {
 bool ArithmeticUnaryOperation::canApplyToType(const Type &type) const {
   return QUICKSTEP_EQUALS_ANY_CONSTANT(
       type.getTypeID(),
-      kInt, kLong, kFloat, kDouble, kDatetimeInterval, kYearMonthInterval);
+      kInt, kLong, kFloat, kDouble, kDecimal, kDatetimeInterval, kYearMonthInterval);
 }
 
 const Type* ArithmeticUnaryOperation::resultTypeForArgumentType(const Type &type) const
{
@@ -66,7 +67,7 @@ const Type* ArithmeticUnaryOperation::pushDownTypeHint(const Type *type_hint)
co
 bool NegateUnaryOperation::resultTypeIsPlausible(const Type &result_type) const {
   return QUICKSTEP_EQUALS_ANY_CONSTANT(
       result_type.getTypeID(),
-      kInt, kLong, kFloat, kDouble, kDatetimeInterval, kYearMonthInterval);
+      kInt, kLong, kFloat, kDouble, kDecimal, kDatetimeInterval, kYearMonthInterval);
 }
 
 TypedValue NegateUnaryOperation::applyToChecked(const TypedValue &argument,
@@ -86,6 +87,8 @@ TypedValue NegateUnaryOperation::applyToChecked(const TypedValue &argument,
       return TypedValue(-argument.getLiteral<typename FloatType::cpptype>());
     case kDouble:
       return TypedValue(-argument.getLiteral<typename DoubleType::cpptype>());
+    case kDecimal:
+      return TypedValue(-argument.getLiteral<typename DecimalType::cpptype>());
     case kDatetimeInterval:
       return TypedValue(-argument.getLiteral<typename DatetimeIntervalType::cpptype>());
     case kYearMonthInterval:
@@ -123,6 +126,12 @@ UncheckedUnaryOperator* NegateUnaryOperation::makeUncheckedUnaryOperatorForType(
       } else {
         return new NegateUncheckedUnaryOperator<DoubleType, false>();
       }
+    case kDecimal:
+      if (type.isNullable()) {
+        return new NegateUncheckedUnaryOperator<DecimalType, true>();
+      } else {
+        return new NegateUncheckedUnaryOperator<DecimalType, false>();
+      }
     case kDatetimeInterval:
       if (type.isNullable()) {
         return new NegateUncheckedUnaryOperator<DatetimeIntervalType, true>();


Mime
View raw message