orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgtmac <...@git.apache.org>
Subject [GitHub] orc pull request #116: ORC-185: [C++] Simplify Statististics Implementation
Date Wed, 03 May 2017 16:53:58 GMT
Github user wgtmac commented on a diff in the pull request:

    https://github.com/apache/orc/pull/116#discussion_r114596687
  
    --- Diff: c++/src/Statistics.hh ---
    @@ -64,103 +64,63 @@ namespace orc {
           hasMaximum_ = false;
           hasSum_ = false;
           hasTotalLength_ = false;
    -      totalLength_ = -1;
    -      valueCount_ = -1;
    +      totalLength_ = 0;
    +      valueCount_ = 0;
         }
     
         ~InternalStatisticsImpl() {}
     
         // GET / SET totalLength_
    -    bool hasTotalLength() const {
    -      return hasTotalLength_;
    -    }
    +    bool hasTotalLength() const {return hasTotalLength_;}
     
    -    void setHasTotalLength(bool hasTotalLength) {
    -      hasTotalLength_ = hasTotalLength;
    -    }
    +    void setHasTotalLength(bool hasTotalLength) {hasTotalLength_ = hasTotalLength;}
     
    -    uint64_t getTotalLength() const {
    -      return totalLength_;
    -    }
    +    uint64_t getTotalLength() const {return totalLength_;}
     
    -    void setTotalLength(uint64_t totalLength) {
    -      totalLength_ = totalLength;
    -    }
    +    void setTotalLength(uint64_t totalLength) {totalLength_ = totalLength;}
     
         // GET / SET sum_
    -    bool hasSum() const {
    -      return hasSum_;
    -    }
    +    bool hasSum() const {return hasSum_;}
     
    -    void setHasSum(bool hasSum) {
    -      hasSum_ = hasSum;
    -    }
    +    void setHasSum(bool hasSum) {hasSum_ = hasSum;}
     
    -    T getSum() const {
    -      return sum_;
    -    }
    +    T getSum() const {return sum_;}
     
    -    void setSum(T sum) {
    -      sum_ = sum;
    -    }
    +    void setSum(T sum) {sum_ = sum;}
     
         // GET / SET maximum_
    -    bool hasMaximum() const {
    -      return hasMaximum_;
    -    }
    +    bool hasMaximum() const {return hasMaximum_;}
     
    -    T getMaximum() const {
    -      return maximum_;
    -    }
    +    T getMaximum() const {return maximum_;}
     
    -    void setHasMaximum(bool hasMax) {
    -      hasMaximum_ = hasMax;
    -    }
    +    void setHasMaximum(bool hasMax) {hasMaximum_ = hasMax;}
     
    -    void setMaximum(T max) {
    -      maximum_ = max;
    -    }
    +    void setMaximum(T max) {maximum_ = max;}
     
         // GET / SET minimum_
    -    bool hasMinimum() const {
    -      return hasMinimum_;
    -    }
    +    bool hasMinimum() const {return hasMinimum_;}
     
    -    void setHasMinimum(bool hasMin) {
    -      hasMinimum_ = hasMin;
    -    }
    +    void setHasMinimum(bool hasMin) {hasMinimum_ = hasMin;}
     
    -    T getMinimum() const {
    -      return minimum_;
    -    }
    +    T getMinimum() const {return minimum_;}
     
    -    void setMinimum(T min) {
    -      minimum_ = min;
    -    }
    +    void setMinimum(T min) {minimum_ = min;}
     
         // GET / SET valueCount_
    -    uint64_t getNumberOfValues() const {
    -      return valueCount_;
    -    }
    +    uint64_t getNumberOfValues() const {return valueCount_;}
     
    -    void setNumberOfValues(uint64_t numValues) {
    -      valueCount_ = numValues;
    -    }
    +    void setNumberOfValues(uint64_t numValues) {valueCount_ = numValues;}
     
         // GET / SET hasNullValue_
    -    bool hasNull() const {
    -      return hasNull_;
    -    }
    +    bool hasNull() const {return hasNull_;}
     
    -    void setHasNull(bool hasNull) {
    -      hasNull_ = hasNull;
    -    }
    +    void setHasNull(bool hasNull) {hasNull_ = hasNull;}
       };
     
       typedef InternalStatisticsImpl<char> InternalCharStatistics;
    -  typedef InternalStatisticsImpl<uint64_t> InternalIntegerStatistics;
    -  typedef InternalStatisticsImpl<uint32_t> InternalDateStatistics;
    -  typedef InternalStatisticsImpl<int64_t> InternalTimestampStatistics;
    +  typedef InternalStatisticsImpl<uint64_t> InternalBooleanIntegerStatistics;
    --- End diff --
    
    Maybe you can separate them as follows:
    typedef InternalStatisticsImpl<uint64_t> InternalIntegerStatistics;
    typedef InternalStatisticsImpl<uint64_t> InternalBooleanStatistics;
    The mixed name is confusing.


---
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.
---

Mime
View raw message