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 B9CF1200CA3 for ; Wed, 3 May 2017 04:16:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B85AA160BAC; Wed, 3 May 2017 02:16:23 +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 3057B160B9D for ; Wed, 3 May 2017 04:16:23 +0200 (CEST) Received: (qmail 64017 invoked by uid 500); 3 May 2017 02:16:22 -0000 Mailing-List: contact dev-help@orc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@orc.apache.org Delivered-To: mailing list dev@orc.apache.org Received: (qmail 64006 invoked by uid 99); 3 May 2017 02:16:22 -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; Wed, 03 May 2017 02:16:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EF589DFC15; Wed, 3 May 2017 02:16:21 +0000 (UTC) From: majetideepak To: dev@orc.apache.org Reply-To: dev@orc.apache.org References: In-Reply-To: Subject: [GitHub] orc pull request #116: ORC-185: [C++] Simplify Statististics Implementation Content-Type: text/plain Message-Id: <20170503021621.EF589DFC15@git1-us-west.apache.org> Date: Wed, 3 May 2017 02:16:21 +0000 (UTC) archived-at: Wed, 03 May 2017 02:16:23 -0000 Github user majetideepak commented on a diff in the pull request: https://github.com/apache/orc/pull/116#discussion_r114463611 --- Diff: c++/src/Statistics.hh --- @@ -41,49 +41,181 @@ namespace orc { }; /** + * Internal Statistics Implementation + */ + + template + class InternalStatisticsImpl { + private: + bool hasNull_; + bool hasMinimum_; + bool hasMaximum_; + bool hasSum_; + bool hasTotalLength_; + uint64_t totalLength_; + uint64_t valueCount_; + T minimum_; + T maximum_; + T sum_; + public: + InternalStatisticsImpl() { + hasNull_ = false; + hasMinimum_ = false; + hasMaximum_ = false; + hasSum_ = false; + hasTotalLength_ = false; + totalLength_ = -1; --- End diff -- 0 is a valid value. I think it is safe if we initialize to an invalid value `-1`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---