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: Adding numeric cast for Decimal type.
Date Mon, 20 Jun 2016 16:35:33 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/decimal-type 5815103db -> f28c46ecc


Adding numeric cast for Decimal type.


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

Branch: refs/heads/decimal-type
Commit: f28c46ecc9450ac01989df0082a8d74a24724b66
Parents: 5815103
Author: Hakan Memisoglu <hakanmemisoglu@apache.org>
Authored: Mon Jun 20 11:35:01 2016 -0500
Committer: Hakan Memisoglu <hakanmemisoglu@apache.org>
Committed: Mon Jun 20 11:35:01 2016 -0500

----------------------------------------------------------------------
 .../unary_operations/NumericCastOperation.hpp   |  4 ++++
 types/tests/DecimalType_unittest.cpp            | 22 ++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/f28c46ec/types/operations/unary_operations/NumericCastOperation.hpp
----------------------------------------------------------------------
diff --git a/types/operations/unary_operations/NumericCastOperation.hpp b/types/operations/unary_operations/NumericCastOperation.hpp
index 250df6d..49da256 100644
--- a/types/operations/unary_operations/NumericCastOperation.hpp
+++ b/types/operations/unary_operations/NumericCastOperation.hpp
@@ -255,6 +255,8 @@ class NumericCastOperation : public UnaryOperation {
         return makeUncheckedUnaryOperatorHelperForSourceNullability<FloatType>(type);
       case kDouble:
         return makeUncheckedUnaryOperatorHelperForSourceNullability<DoubleType>(type);
+      case kDecimal:
+        return makeUncheckedUnaryOperatorHelperForSourceNullability<DecimalType>(type);
       default:
         FATAL_ERROR("Unhandled type " << kTypeNames[type.getTypeID()]);
     }
@@ -285,6 +287,8 @@ class NumericCastOperation : public UnaryOperation {
         return makeUncheckedUnaryOperatorHelperForTargetNullability<SourceType, source_nullability,
FloatType>();
       case kDouble:
         return makeUncheckedUnaryOperatorHelperForTargetNullability<SourceType, source_nullability,
DoubleType>();
+      case kDecimal:
+        return makeUncheckedUnaryOperatorHelperForTargetNullability<SourceType, source_nullability,
DecimalType>();
       default:
         FATAL_ERROR("Unhandled type " << kTypeNames[target_type_.getTypeID()]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/f28c46ec/types/tests/DecimalType_unittest.cpp
----------------------------------------------------------------------
diff --git a/types/tests/DecimalType_unittest.cpp b/types/tests/DecimalType_unittest.cpp
index 052848b..78a79ab 100644
--- a/types/tests/DecimalType_unittest.cpp
+++ b/types/tests/DecimalType_unittest.cpp
@@ -1,3 +1,22 @@
+/**
+ *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
+ *     University of Wisconsin—Madison.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ **/
+
+#include <string>
+
 #include "types/DecimalLit.hpp"
 #include "types/DecimalType.hpp"
 #include "types/Type.hpp"
@@ -60,5 +79,4 @@ TEST(DecimalTypeTest, DecimalLitOperationsTest) {
             decimal_type.printValueToString(TypedValue(decimal_a % decimal_b)));
 }
 
-
-}
+}  // namespace quickstep


Mime
View raw message