[ 
https://issues.apache.org/jira/browse/ORC-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995202#comment-15995202
 ] 

ASF GitHub Bot commented on ORC-185:
------------------------------------

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.


> [C++] Simplify Statististics Implementation
> -------------------------------------------
>
>                 Key: ORC-185
>                 URL: https://issues.apache.org/jira/browse/ORC-185
>             Project: ORC
>          Issue Type: Bug
>            Reporter: Deepak Majeti
>            Assignee: Deepak Majeti
>
> There is a lot of code duplication in the current ColumnStatistics 
> implementation. The scope of this JIRA is to use templates to reuse code as 
> much as possible.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to