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

    
https://github.com/apache/incubator-carbondata/pull/672#discussion_r107894484
  
    --- Diff: 
integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonInputFormat.java
 ---
    @@ -0,0 +1,99 @@
    +/*
    + * 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.hive;
    +
    +import java.io.IOException;
    +import java.util.List;
    +
    +import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
    +import org.apache.carbondata.core.scan.expression.Expression;
    +import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf;
    +import org.apache.carbondata.core.scan.model.CarbonQueryPlan;
    +import org.apache.carbondata.core.scan.model.QueryModel;
    +import org.apache.carbondata.hadoop.CarbonInputFormat;
    +import org.apache.carbondata.hadoop.CarbonInputSplit;
    +import org.apache.carbondata.hadoop.readsupport.CarbonReadSupport;
    +import org.apache.carbondata.hadoop.util.CarbonInputFormatUtil;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.fs.Path;
    +import org.apache.hadoop.hive.ql.io.CombineHiveInputFormat;
    +import org.apache.hadoop.io.ArrayWritable;
    +import org.apache.hadoop.mapred.InputFormat;
    +import org.apache.hadoop.mapred.InputSplit;
    +import org.apache.hadoop.mapred.JobConf;
    +import org.apache.hadoop.mapred.RecordReader;
    +import org.apache.hadoop.mapred.Reporter;
    +import org.apache.hadoop.mapreduce.Job;
    +
    +
    +public class MapredCarbonInputFormat extends 
CarbonInputFormat<ArrayWritable>
    +    implements InputFormat<Void, ArrayWritable>, 
CombineHiveInputFormat.AvoidSplitCombination {
    +
    +  @Override
    +  public InputSplit[] getSplits(JobConf jobConf, int numSplits) throws 
IOException {
    +    org.apache.hadoop.mapreduce.JobContext jobContext = 
Job.getInstance(jobConf);
    +    List<org.apache.hadoop.mapreduce.InputSplit> splitList = 
super.getSplits(jobContext);
    +    InputSplit[] splits = new InputSplit[splitList.size()];
    +    CarbonInputSplit split = null;
    +    for (int i = 0; i < splitList.size(); i++) {
    +      split = (CarbonInputSplit) splitList.get(i);
    +      splits[i] = new CarbonHiveInputSplit(split.getSegmentId(), 
split.getPath(),
    +          split.getStart(), split.getLength(), split.getLocations(),
    +          split.getNumberOfBlocklets(), split.getVersion(), 
split.getBlockStorageIdMap());
    +    }
    +    return splits;
    +  }
    +
    +  @Override
    +  public RecordReader<Void, ArrayWritable> getRecordReader(InputSplit 
inputSplit, JobConf jobConf,
    +                                                           Reporter 
reporter) throws IOException {
    +    QueryModel queryModel = getQueryModel(jobConf);
    +    CarbonReadSupport<ArrayWritable> readSupport = 
getReadSupportClass(jobConf);
    --- End diff --
    
    need decode all dictionary columns and direct-dictionary columns.
    Better to use SparkRowReadSupportImpl in spark1 module.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to