carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #971: [CARBONDATA-1015] Extract interface in data lo...
Date Fri, 02 Jun 2017 08:12:38 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/971#discussion_r119802447
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java ---
    @@ -549,24 +562,23 @@ private static ValueEncoderMeta deserializeValueEncoderMeta(ByteBuffer
byteBuffe
     
       }
     
    -  private static WriterCompressModel getValueCompressionModel(ValueEncoderMeta[] encoderMetas)
{
    -    Object[] maxValue = new Object[encoderMetas.length];
    -    Object[] minValue = new Object[encoderMetas.length];
    -    int[] decimalLength = new int[encoderMetas.length];
    -    Object[] uniqueValue = new Object[encoderMetas.length];
    -    DataType[] aggType = new DataType[encoderMetas.length];
    +  private static MeasurePageStatistics getMeasurePageStats(ValueEncoderMeta[] encoderMetas)
{
    +    Object[] max = new Object[encoderMetas.length];
    +    Object[] min = new Object[encoderMetas.length];
    +    int[] decimal = new int[encoderMetas.length];
    +    Object[] nonExistValue = new Object[encoderMetas.length];
    +    DataType[] types = new DataType[encoderMetas.length];
         byte[] dataTypeSelected = new byte[encoderMetas.length];
         for (int i = 0; i < encoderMetas.length; i++) {
    -      maxValue[i] = encoderMetas[i].getMaxValue();
    -      minValue[i] = encoderMetas[i].getMinValue();
    -      decimalLength[i] = encoderMetas[i].getDecimal();
    -      uniqueValue[i] = encoderMetas[i].getUniqueValue();
    -      aggType[i] = encoderMetas[i].getType();
    +      max[i] = encoderMetas[i].getMaxValue();
    +      min[i] = encoderMetas[i].getMinValue();
    +      decimal[i] = encoderMetas[i].getDecimal();
    +      nonExistValue[i] = encoderMetas[i].getUniqueValue();
    +      types[i] = encoderMetas[i].getType();
           dataTypeSelected[i] = encoderMetas[i].getDataTypeSelected();
         }
    -    return ValueCompressionUtil
    -        .getWriterCompressModel(maxValue, minValue, decimalLength, uniqueValue, aggType,
    -            dataTypeSelected);
    +
    +    return MeasurePageStatistics.build(min, max, nonExistValue, decimal, types, dataTypeSelected);
    --- End diff --
    
    Better pass `ValueEncoderMeta` list to `build` method to avoid duplicate code in other
places


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