Package org.apache.drill.exec.planner
Interface PartitionDescriptor
- All Superinterfaces:
Iterable<List<PartitionLocation>>
- All Known Implementing Classes:
AbstractPartitionDescriptor
,FileSystemPartitionDescriptor
,HivePartitionDescriptor
,ParquetPartitionDescriptor
Interface used to describe partitions. Currently used by file system based
partitions and hive partitions
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.rel.core.TableScan
createTableScan
(List<PartitionLocation> newPartitions, boolean wasAllPartitionsPruned) Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.org.apache.calcite.rel.core.TableScan
createTableScan
(List<PartitionLocation> newPartitions, 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.Path
getIdIfValid
(String name) Check to see if the name is a partition name.int
Maximum level of partition nesting/ hierarchy supportedint
getPartitionHierarchyIndex
(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") => 2getVectorType
(SchemaPath column, PlannerSettings plannerSettings) Method returns the Major type associated with the given columnboolean
isPartitionName
(String name) Given a column name return boolean to indicate if its a partition column or notvoid
populatePartitionVectors
(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer, String> fieldNameMap) Creates an in memory representation of all the partitions.boolean
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
PARTITION_BATCH_SIZE
static final int PARTITION_BATCH_SIZE- See Also:
-
-
Method Details
-
getPartitionHierarchyIndex
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") => 2- Parameters:
partitionName
- Partition name- Returns:
- the index of specified partition name in the hierarchy
-
isPartitionName
Given 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
Check 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
int getMaxHierarchyLevel()Maximum level of partition nesting/ hierarchy supported- Returns:
- maximum supported level number of partition hierarchy
-
populatePartitionVectors
void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer, String> fieldNameMap) Creates 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
Method returns the Major type associated with the given column- Parameters:
column
- - column whose type should be determinedplannerSettings
-
-
createTableScan
org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, boolean wasAllPartitionsPruned) throws Exception Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.- Parameters:
newPartitions
-wasAllPartitionsPruned
-- Throws:
Exception
-
createTableScan
org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) throws Exception Create a new TableScan rel node, given the lists of new partitions or new files to scan and a path to a metadata cache file- Parameters:
newPartitions
-cacheFileRoot
-wasAllPartitionsPruned
-metaContext
-- Throws:
Exception
-
supportsMetadataCachePruning
boolean supportsMetadataCachePruning() -
getBaseTableLocation
org.apache.hadoop.fs.Path getBaseTableLocation()
-