Search in sources :

Example 6 with LogicalInputSplit

use of org.apache.drill.exec.store.hive.HiveMetadataProvider.LogicalInputSplit in project drill by apache.

the class HiveScan method applyAssignments.

@Override
public void applyAssignments(final List<CoordinationProtos.DrillbitEndpoint> endpoints) {
    mappings = new ArrayList<>();
    for (int i = 0; i < endpoints.size(); i++) {
        mappings.add(new ArrayList<>());
    }
    final int count = endpoints.size();
    final List<LogicalInputSplit> inputSplits = getInputSplits();
    for (int i = 0; i < inputSplits.size(); i++) {
        mappings.get(i % count).add(inputSplits.get(i));
    }
}
Also used : LogicalInputSplit(org.apache.drill.exec.store.hive.HiveMetadataProvider.LogicalInputSplit) DrillbitEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)

Aggregations

LogicalInputSplit (org.apache.drill.exec.store.hive.HiveMetadataProvider.LogicalInputSplit)6 IOException (java.io.IOException)4 DrillbitEndpoint (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)2 List (java.util.List)2 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)2 ExecutionSetupException (org.apache.drill.common.exceptions.ExecutionSetupException)2 EndpointAffinity (org.apache.drill.exec.physical.EndpointAffinity)2 HivePartitionWrapper (org.apache.drill.exec.store.hive.HiveTableWrapper.HivePartitionWrapper)2 Partition (org.apache.hadoop.hive.metastore.api.Partition)2