Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 386D3200AF7 for ; Tue, 14 Jun 2016 17:10:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37370160A47; Tue, 14 Jun 2016 15:10:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 820E6160A06 for ; Tue, 14 Jun 2016 17:10:49 +0200 (CEST) Received: (qmail 49872 invoked by uid 500); 14 Jun 2016 15:10:48 -0000 Mailing-List: contact commits-help@quickstep.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@quickstep.incubator.apache.org Delivered-To: mailing list commits@quickstep.incubator.apache.org Received: (qmail 49863 invoked by uid 99); 14 Jun 2016 15:10:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 15:10:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 539CDC0253 for ; Tue, 14 Jun 2016 15:10:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Fue7jjKDisZL for ; Tue, 14 Jun 2016 15:10:47 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id 29CD35F296 for ; Tue, 14 Jun 2016 15:10:46 +0000 (UTC) Received: (qmail 49811 invoked by uid 99); 14 Jun 2016 15:10:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 15:10:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 59514DFFF8; Tue, 14 Jun 2016 15:10:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hakanmemisoglu@apache.org To: commits@quickstep.incubator.apache.org Message-Id: <4a10a8c8bcce4d6288ff2358cd5a47ea@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-quickstep git commit: New changes. Date: Tue, 14 Jun 2016 15:10:46 +0000 (UTC) archived-at: Tue, 14 Jun 2016 15:10:50 -0000 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 Authored: Tue Jun 14 10:09:25 2016 -0500 Committer: Hakan Memisoglu 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 #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()); case kDouble: return TypedValue(-argument.getLiteral()); + case kDecimal: + return TypedValue(-argument.getLiteral()); case kDatetimeInterval: return TypedValue(-argument.getLiteral()); case kYearMonthInterval: @@ -123,6 +126,12 @@ UncheckedUnaryOperator* NegateUnaryOperation::makeUncheckedUnaryOperatorForType( } else { return new NegateUncheckedUnaryOperator(); } + case kDecimal: + if (type.isNullable()) { + return new NegateUncheckedUnaryOperator(); + } else { + return new NegateUncheckedUnaryOperator(); + } case kDatetimeInterval: if (type.isNullable()) { return new NegateUncheckedUnaryOperator();