orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omalley <...@git.apache.org>
Subject [GitHub] orc pull request #292: ORC-203 - Update StringStatistics to trim long string...
Date Wed, 25 Jul 2018 16:42:39 GMT
Github user omalley commented on a diff in the pull request:

    https://github.com/apache/orc/pull/292#discussion_r205179439
  
    --- Diff: java/core/src/java/org/apache/orc/impl/ColumnStatisticsImpl.java ---
    @@ -621,12 +703,54 @@ public void merge(ColumnStatisticsImpl other) {
     
         @Override
         public String getMinimum() {
    -      return minimum == null ? null : minimum.toString();
    +      /* if we have lower bound set (in case of truncation)
    +      getMinimum will be null */
    +      if(isLowerBoundSet) {
    +        return null;
    +      } else {
    +        return minimum == null ? null : minimum.toString();
    +      }
         }
     
         @Override
         public String getMaximum() {
    -      return maximum == null ? null : maximum.toString();
    +      /* if we have upper bound is set (in case of truncation)
    +      getMaximum will be null */
    +      if(isUpperBoundSet) {
    +        return null;
    +      } else {
    +        return maximum == null ? null : maximum.toString();
    +      }
    +    }
    +
    +    /**
    +     * Get the string with
    +     * length = Min(StringStatisticsImpl.MAX_STRING_LENGTH_RECORDED, getMinimum())
    +     *
    +     * @return lower bound
    +     */
    +    @Override
    +    public String getLowerBound() {
    +      if(isLowerBoundSet) {
    +        return minimum.toString();
    +      } else {
    +        return null;
    +      }
    +    }
    +
    +    /**
    +     * Get the string with
    +     * length = Min(StringStatisticsImpl.MAX_STRING_LENGTH_RECORDED, getMaximum())
    +     *
    +     * @return upper bound
    +     */
    +    @Override
    +    public String getUpperBound() {
    +      if(isUpperBoundSet) {
    +        return maximum.toString();
    +      } else {
    +        return null;
    --- End diff --
    
    This should always return maximum.


---

Mime
View raw message