Package org.apache.drill.exec.planner
Class FileSystemPartitionDescriptor
java.lang.Object
org.apache.drill.exec.planner.AbstractPartitionDescriptor
org.apache.drill.exec.planner.FileSystemPartitionDescriptor
- All Implemented Interfaces:
Iterable<List<PartitionLocation>>,PartitionDescriptor
Partition descriptor for file system based tables.
-
Field Summary
Fields inherited from class org.apache.drill.exec.planner.AbstractPartitionDescriptor
locationSuperList, sublistsCreatedFields inherited from interface org.apache.drill.exec.planner.PartitionDescriptor
PARTITION_BATCH_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionFileSystemPartitionDescriptor(PlannerSettings settings, org.apache.calcite.rel.core.TableScan scanRel) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreate sublists of the partition locations, each sublist of size at mostPartitionDescriptor.PARTITION_BATCH_SIZEorg.apache.calcite.rel.core.TableScancreateTableScan(List<PartitionLocation> newPartitionLocation, boolean wasAllPartitionsPruned) Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.org.apache.calcite.rel.core.TableScancreateTableScan(List<PartitionLocation> newPartitionLocation, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) Create a new TableScan rel node, given the lists of new partitions or new files to scan and a path to a metadata cache fileorg.apache.hadoop.fs.Pathprotected org.apache.commons.lang3.tuple.Pair<Collection<org.apache.hadoop.fs.Path>, Boolean> getIdIfValid(String name) Check to see if the name is a partition name.intMaximum level of partition nesting/ hierarchy supportedgetName(int index) intgetPartitionHierarchyIndex(String partitionName) Get the hierarchy index of the given partition For eg: if we have the partition laid out as follows 1997/q1/jan then getPartitionHierarchyIndex("jan") => 2getTable()getVectorType(SchemaPath column, PlannerSettings plannerSettings) Method returns the Major type associated with the given columnbooleanisPartitionName(String name) Given a column name return boolean to indicate if its a partition column or notvoidpopulatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer, String> fieldNameMap) Creates an in memory representation of all the partitions.booleanMethods inherited from class org.apache.drill.exec.planner.AbstractPartitionDescriptor
iteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FileSystemPartitionDescriptor
public FileSystemPartitionDescriptor(PlannerSettings settings, org.apache.calcite.rel.core.TableScan scanRel)
-
-
Method Details
-
getPartitionHierarchyIndex
Description copied from interface:PartitionDescriptorGet the hierarchy index of the given partition For eg: if we have the partition laid out as follows 1997/q1/jan then getPartitionHierarchyIndex("jan") => 2- Parameters:
partitionName- Partition name- Returns:
- the index of specified partition name in the hierarchy
-
isPartitionName
Description copied from interface:PartitionDescriptorGiven a column name return boolean to indicate if its a partition column or not- Parameters:
name- of Partition- Returns:
- true, if this is the partition name and vise versa.
-
getIdIfValid
Description copied from interface:PartitionDescriptorCheck to see if the name is a partition name.- Parameters:
name- The field name you want to compare to partition names.- Returns:
- Return index if valid, otherwise return null;
-
getMaxHierarchyLevel
public int getMaxHierarchyLevel()Description copied from interface:PartitionDescriptorMaximum level of partition nesting/ hierarchy supported- Returns:
- maximum supported level number of partition hierarchy
-
getTable
-
populatePartitionVectors
public void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer, String> fieldNameMap) Description copied from interface:PartitionDescriptorCreates an in memory representation of all the partitions. For each level of partitioning we will create a value vector which this method will populate for all the partitions with the values of the partitioning key- Parameters:
vectors- - Array of vectors in the container that need to be populatedpartitions- - List of all the partitions that exist in the tablepartitionColumnBitSet- - Partition columns selected in the queryfieldNameMap- - Maps field ordinal to the field name
-
getVectorType
Description copied from interface:PartitionDescriptorMethod returns the Major type associated with the given column- Parameters:
column- - column whose type should be determinedplannerSettings-
-
getName
-
getBaseTableLocation
public org.apache.hadoop.fs.Path getBaseTableLocation() -
createPartitionSublists
protected void createPartitionSublists()Description copied from class:AbstractPartitionDescriptorCreate sublists of the partition locations, each sublist of size at mostPartitionDescriptor.PARTITION_BATCH_SIZE- Specified by:
createPartitionSublistsin classAbstractPartitionDescriptor
-
getFileLocationsAndStatus
protected org.apache.commons.lang3.tuple.Pair<Collection<org.apache.hadoop.fs.Path>,Boolean> getFileLocationsAndStatus() -
createTableScan
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitionLocation, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) throws Exception Description copied from interface:PartitionDescriptorCreate a new TableScan rel node, given the lists of new partitions or new files to scan and a path to a metadata cache file- Specified by:
createTableScanin interfacePartitionDescriptor- Overrides:
createTableScanin classAbstractPartitionDescriptor- Parameters:
newPartitionLocation-cacheFileRoot-wasAllPartitionsPruned-metaContext-- Throws:
Exception
-
createTableScan
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitionLocation, boolean wasAllPartitionsPruned) throws Exception Description copied from interface:PartitionDescriptorCreate a new TableScan rel node, given the lists of new partitions or new files to SCAN.- Parameters:
newPartitionLocation-wasAllPartitionsPruned-- Throws:
Exception
-
supportsMetadataCachePruning
public boolean supportsMetadataCachePruning()- Specified by:
supportsMetadataCachePruningin interfacePartitionDescriptor- Overrides:
supportsMetadataCachePruningin classAbstractPartitionDescriptor
-