Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2662#discussion_r213161218
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/page/FallbackDecoderBasedColumnPageEncoder.java
 ---
    @@ -0,0 +1,98 @@
    +/*
    + * 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;
    +
    +import java.util.concurrent.Callable;
    +
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.datastore.TableSpec;
    +import org.apache.carbondata.core.datastore.compression.CompressorFactory;
    +import 
org.apache.carbondata.core.datastore.page.encoding.EncodedColumnPage;
    +import org.apache.carbondata.core.keygenerator.KeyGenerator;
    +import org.apache.carbondata.core.keygenerator.factory.KeyGeneratorFactory;
    +import 
org.apache.carbondata.core.localdictionary.generator.LocalDictionaryGenerator;
    +import org.apache.carbondata.core.metadata.datatype.DataType;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +
    +public class FallbackDecoderBasedColumnPageEncoder implements 
Callable<FallbackEncodedColumnPage> {
    +  /**
    +   * actual local dictionary generated column page
    +   */
    +  private EncodedColumnPage encodedColumnPage;
    +
    +  /**
    +   * actual index in the page
    +   * this is required as in a blocklet few pages will be local dictionary
    +   * encoded and few pages will be plain text encoding
    +   * in this case local dictionary encoded page
    +   */
    +  private int pageIndex;
    +
    +  private LocalDictionaryGenerator localDictionaryGenerator;
    +
    +  public FallbackDecoderBasedColumnPageEncoder(EncodedColumnPage 
encodedColumnPage, int pageIndex,
    +      LocalDictionaryGenerator localDictionaryGenerator) {
    +    this.encodedColumnPage = encodedColumnPage;
    +    this.pageIndex = pageIndex;
    +    this.localDictionaryGenerator = localDictionaryGenerator;
    +  }
    +
    +  @Override public FallbackEncodedColumnPage call() throws Exception {
    +
    +    // uncompress the encoded column page
    +    byte[] bytes = CompressorFactory.getInstance().getCompressor()
    --- End diff --
    
    emm, PR #2628 changed this. We should get the compressor from input 
configuration or from the metadata.


---

Reply via email to