carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1179: [CARBONDATA-1364] Added the blocklet info to ...
Date Mon, 07 Aug 2017 16:45:21 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1179#discussion_r131705354
  
    --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/api/DistributableDataMapFormat.java
---
    @@ -0,0 +1,135 @@
    +/*
    + * 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.hadoop.api;
    +
    +import java.io.IOException;
    +import java.io.Serializable;
    +import java.util.ArrayList;
    +import java.util.Iterator;
    +import java.util.List;
    +
    +import org.apache.carbondata.core.indexstore.Blocklet;
    +import org.apache.carbondata.core.indexstore.DataMapDistributable;
    +import org.apache.carbondata.core.indexstore.DataMapStoreManager;
    +import org.apache.carbondata.core.indexstore.DataMapType;
    +import org.apache.carbondata.core.indexstore.TableDataMap;
    +import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
    +import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf;
    +import org.apache.carbondata.hadoop.util.ObjectSerializationUtil;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.mapreduce.InputSplit;
    +import org.apache.hadoop.mapreduce.JobContext;
    +import org.apache.hadoop.mapreduce.RecordReader;
    +import org.apache.hadoop.mapreduce.TaskAttemptContext;
    +import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
    +
    +/**
    + * Input format for datamaps, it makes the datamap pruning distributable.
    + */
    +public class DistributableDataMapFormat extends FileInputFormat<Void, Blocklet>
implements
    +    Serializable {
    +
    +  private static final String FILTER_EXP = "mapreduce.input.distributed.datamap.filter";
    +
    +  private AbsoluteTableIdentifier identifier;
    +
    +  private String dataMapName;
    +
    +  private DataMapType dataMapType;
    +
    +  private List<String> validSegments;
    +
    +  public DistributableDataMapFormat(AbsoluteTableIdentifier identifier, String dataMapName,
    +      DataMapType dataMapType, List<String> validSegments) {
    +    this.identifier = identifier;
    +    this.dataMapName = dataMapName;
    +    this.dataMapType = dataMapType;
    +    this.validSegments = validSegments;
    +  }
    +
    +  public static void setFilterExp(Configuration configuration, FilterResolverIntf filterExp)
    +      throws IOException {
    +    if (filterExp != null) {
    +      String string = ObjectSerializationUtil.convertObjectToString(filterExp);
    +      configuration.set(FILTER_EXP, string);
    +    }
    +  }
    +
    +  private static FilterResolverIntf getFilterExp(Configuration configuration) throws
IOException {
    +    String filterString = configuration.get(FILTER_EXP);
    +    if (filterString != null) {
    +      Object toObject = ObjectSerializationUtil.convertStringToObject(filterString);
    +      return (FilterResolverIntf) toObject;
    +    }
    +    return null;
    +  }
    +
    +  @Override public List<InputSplit> getSplits(JobContext job) throws IOException
{
    +    TableDataMap dataMap =
    +        DataMapStoreManager.getInstance().getDataMap(identifier, dataMapName, dataMapType);
    +    List<DataMapDistributable> distributables = dataMap.toDistributable(validSegments);
    --- End diff --
    
    Can we first filter on the segment based on minmax ? If segments are more, even map reduce
will take times


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