[GitHub] carbondata pull request #987: [WIP] Use ColumnPage for measure encoding and ...

classic Classic list List threaded Threaded
93 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/182/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2310/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/184/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    retest this please


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/200/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2323/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/210/<h2>Failed Tests: <span class='status-failure'>3</span></h2><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/210/org.apache.carbondata$carbondata-spark/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark</a>: <span class='status-failure'>2</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/210/org.apache.carbondata$carbondata-spark/testReport/org.apache.carbondata.spark.util/AutoHighCardinalityIdentifyTestCase/auto_identify_high_cardinality_column_in_first_load__396/'><strong>org.apache.carbondata.spark.util.AutoHighCardinalityIdentifyTestCase.auto identify high cardinality column in first load #396</strong></a></li><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/210/org.apache.carbondata$carbondata-spark/testReport/org.apache.carbondata.spark.util/AutoHighCar
 dinalityIdentifyTestCase/skip_auto_identify_high_cardinality_column_for_column_group/'><strong>org.apache.carbondata.spark.util.AutoHighCardinalityIdentifyTestCase.skip auto identify high cardinality column for column group</strong></a></li></ul><h3><a name='carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test' /><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/210/org.apache.carbondata$carbondata-spark-common-test/testReport'>carbondata-pr-spark-1.6/org.apache.carbondata:carbondata-spark-common-test</a>: <span class='status-failure'>1</span></h3><ul><li><a href='https://builds.apache.org/job/carbondata-pr-spark-1.6/210/org.apache.carbondata$carbondata-spark-common-test/testReport/org.apache.carbondata.spark.testsuite.allqueries/InsertIntoCarbonTableTestCase/insert_into_carbon_table_from_carbon_table_union_query/'><strong>org.apache.carbondata.spark.testsuite.allqueries.InsertIntoCarbonTableTestCase.insert into carbon table from carbon table union
  query</strong></a></li></ul>



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2333/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    retest this please


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2337/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/214/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/carbondata-pr-spark-1.6/284/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #987: [CARBONDATA-1017] Add EncodingStrategy and use Column...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/987
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/2405/



---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121509773
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/cache/dictionary/DoubleArrayTrieDictionary.java ---
    @@ -43,7 +43,7 @@
       private static final int UUSD_ROOM_VALUE = -2;   // unused position, only for zero
       private static final int EPTY_BACK_VALUE = 0;    // value of empty position
     
    -  private static final int ENCODE_BASE_VALUE = 10; // encode start number
    +  private static final int ENCODE_BASE_VALUE = 10; // apply start number
    --- End diff --
   
    I think no need to change this file


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121577179
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java ---
    @@ -22,22 +22,38 @@
     import java.util.BitSet;
     
     import org.apache.carbondata.core.constants.CarbonCommonConstants;
    -import org.apache.carbondata.core.datastore.page.statistics.ColumnPageStatistics;
    +import org.apache.carbondata.core.constants.CarbonV3DataFormatConstants;
    +import org.apache.carbondata.core.datastore.compression.Compressor;
    +import org.apache.carbondata.core.datastore.page.statistics.ColumnPageStatsVO;
     import org.apache.carbondata.core.metadata.datatype.DataType;
    +import org.apache.carbondata.core.util.ByteUtil;
    +import org.apache.carbondata.core.util.CarbonProperties;
     import org.apache.carbondata.core.util.DataTypeUtil;
     
    -// Represent a columnar data in one page for one column.
    +import static org.apache.carbondata.core.metadata.datatype.DataType.BYTE;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.DECIMAL;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.DOUBLE;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.FLOAT;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.INT;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.LONG;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.SHORT;
    +import static org.apache.carbondata.core.metadata.datatype.DataType.STRING;
    +
    +/**
    + * Represent a columnar data in one page for one column.
    + */
     public class ColumnPage {
     
    -  protected final DataType dataType;
    -  protected final int pageSize;
    -  protected ColumnPageStatistics stats;
    +  private final int pageSize;
    +  private DataType dataType;
    +  private ColumnPageStatsVO stats;
    --- End diff --
   
    I think ColumnPageStats supposed to be interface so that user can implement to have his own stats


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121579752
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java ---
    @@ -22,22 +22,38 @@
     import java.util.BitSet;
     
     import org.apache.carbondata.core.constants.CarbonCommonConstants;
    -import org.apache.carbondata.core.datastore.page.statistics.ColumnPageStatistics;
    --- End diff --
   
    I think we should unify KeyColumnPage and ColumnPage or atleast one is derived from another.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121579950
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/ColumnPage.java ---
    @@ -46,51 +62,157 @@
       // The index of the rowId whose value is null, will be set to 1
       private BitSet nullBitSet;
     
    -  public ColumnPage(DataType dataType, int pageSize) {
    -    this.dataType = dataType;
    +  protected ColumnPage(DataType dataType, int pageSize) {
         this.pageSize = pageSize;
    -    this.stats = new ColumnPageStatistics(dataType);
    -    this.nullBitSet = new BitSet(pageSize);
    +    this.dataType = dataType;
    +  }
    +
    +  // create a new page
    +  public static ColumnPage newPage(DataType dataType, int pageSize) {
    +    ColumnPage instance;
         switch (dataType) {
    +      case BYTE:
    +        instance = newBytePage(new byte[pageSize]);
    +        break;
           case SHORT:
    +        instance = newShortPage(new short[pageSize]);
    +        break;
           case INT:
    +        instance = newIntPage(new int[pageSize]);
    +        break;
           case LONG:
    -        longData = new long[pageSize];
    +        instance = newLongPage(new long[pageSize]);
    +        break;
    +      case FLOAT:
    +        instance = newFloatPage(new float[pageSize]);
             break;
           case DOUBLE:
    -        doubleData = new double[pageSize];
    +        instance = newDoublePage(new double[pageSize]);
             break;
           case DECIMAL:
    -        byteArrayData = new byte[pageSize][];
    +        instance = newDecimalPage(new byte[pageSize][]);
             break;
           case STRING:
    -        byteArrayData = new byte[pageSize][];
    +        instance = newStringPage(new byte[pageSize][]);
             break;
           default:
             throw new RuntimeException("Unsupported data dataType: " + dataType);
         }
    +    instance.stats = new ColumnPageStatsVO(dataType);
    +    instance.nullBitSet = new BitSet(pageSize);
    +    return instance;
    +  }
    +
    +  // create a new page and set data with input `pageData`
    +  public static ColumnPage newPage(DataType dataType, Object pageData) {
    +    // This is used in read path, since statistics and nullBitSet is not required, not creating
    +    // them to make object minimum
    +    switch (dataType) {
    +      case BYTE:
    +        byte[] byteData = (byte[]) pageData;
    +        return newBytePage(byteData);
    +      case SHORT:
    +        short[] shortData = (short[]) pageData;
    +        return newShortPage(shortData);
    +      case INT:
    +        int[] intData = (int[]) pageData;
    +        return newIntPage(intData);
    +      case LONG:
    +        long[] longData = (long[]) pageData;
    +        return newLongPage(longData);
    +      case FLOAT:
    +        float[] floatData = (float[]) pageData;
    +        return newFloatPage(floatData);
    +      case DOUBLE:
    +        double[] doubleData = (double[]) pageData;
    +        return newDoublePage(doubleData);
    +      case DECIMAL:
    +        byte[][] decimalData = (byte[][]) pageData;
    +        return newDecimalPage(decimalData);
    +      case STRING:
    --- End diff --
   
    Better change this to BYTE_ARRAY and bring KeyColumnPage also here


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121580390
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/PrimitiveCodec.java ---
    @@ -0,0 +1,50 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.core.datastore.page;
    +
    +// no operation, new value = page value
    +//  NO_OP,
    +//
    +//      // new value = (max value of page) - (page value)
    +//      MAX_DELTA,
    +//
    +//      // new value = (10 power of decimal) * (page value)
    +//      UPSCALE,
    +//
    +//      // new value = (10 power of decimal) * ((max value of page) - (page value))
    +//      UPSCALE_MAX_DELTA
    +
    +// Transformation type that can be applied to ColumnPage
    +public interface PrimitiveCodec {
    --- End diff --
   
    We better bring RLE of mdk also to similar interfaces, may we can work on future PR.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121580534
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/AdaptiveIntegerCodec.java ---
    @@ -0,0 +1,213 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.carbondata.core.datastore.page.encoding;
    +
    +import org.apache.carbondata.core.datastore.compression.Compressor;
    +import org.apache.carbondata.core.datastore.page.ColumnPage;
    +import org.apache.carbondata.core.datastore.page.LazyColumnPage;
    +import org.apache.carbondata.core.datastore.page.PrimitiveCodec;
    +import org.apache.carbondata.core.datastore.page.statistics.ColumnPageStatsVO;
    +import org.apache.carbondata.core.metadata.datatype.DataType;
    +
    +/**
    + * Codec for integer (byte, short, int, long) data type page.
    + * This codec will do type casting on page data to make storage minimum.
    + */
    +class AdaptiveIntegerCodec extends AdaptiveCompressionCodec {
    +
    +  private ColumnPage encodedPage;
    +
    +  public static ColumnPageCodec newInstance(DataType srcDataType, DataType targetDataType,
    +      ColumnPageStatsVO stats, Compressor compressor) {
    +    return new AdaptiveIntegerCodec(srcDataType, targetDataType, stats, compressor);
    +  }
    +
    +  private AdaptiveIntegerCodec(DataType srcDataType, DataType targetDataType,
    +      ColumnPageStatsVO stats, Compressor compressor) {
    +    super(srcDataType, targetDataType, stats, compressor);
    +  }
    +
    +  @Override
    +  public String getName() {
    +    return "AdaptiveIntegerCodec";
    +  }
    +
    +  @Override
    +  public byte[] encode(ColumnPage input) {
    +    if (srcDataType.equals(targetDataType)) {
    +      return input.compress(compressor);
    +    } else {
    +      encodedPage = ColumnPage.newPage(targetDataType, input.getPageSize());
    +      input.encode(codec);
    +      return encodedPage.compress(compressor);
    +    }
    +  }
    +
    +  @Override
    +  public ColumnPage decode(byte[] input, int offset, int length) {
    +    if (srcDataType.equals(targetDataType)) {
    +      return ColumnPage.decompress(compressor, targetDataType, input, offset, length);
    +    } else {
    +      ColumnPage page = ColumnPage.decompress(compressor, targetDataType, input, offset, length);
    +      return LazyColumnPage.newPage(page, codec);
    +    }
    +  }
    +
    +  private PrimitiveCodec codec = new PrimitiveCodec() {
    +    @Override
    +    public void encode(int rowId, byte value) {
    +      switch (targetDataType) {
    +        default:
    +          assert (false);
    +          throw new RuntimeException("internal error: " + debugInfo());
    +      }
    +    }
    +
    +    @Override
    +    public void encode(int rowId, short value) {
    +      switch (targetDataType) {
    +        case BYTE:
    +          encodedPage.putByte(rowId, (byte) value);
    +          break;
    +        default:
    +          assert (false);
    --- End diff --
   
    This assertion is not required as we are already throwing exception


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #987: [CARBONDATA-1017] Add EncodingStrategy and use...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/987#discussion_r121580802
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/ColumnPageCodec.java ---
    @@ -21,15 +21,28 @@
     
     /**
      *  Codec for a column page data, implementation should not keep state across pages,
    - *  caller will use the same object to encode multiple pages.
    + *  caller may use the same object to apply multiple pages.
      */
    -public interface ColumnCodec {
    +public interface ColumnPageCodec {
    --- End diff --
   
    We better bring RLE of mdk also to similar interfaces, may we can work on future PR.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
12345