Class HivePartitionDescriptor
java.lang.Object
org.apache.drill.exec.planner.AbstractPartitionDescriptor
org.apache.drill.exec.planner.sql.HivePartitionDescriptor
- All Implemented Interfaces:
Iterable<List<PartitionLocation>>
,PartitionDescriptor
-
Field Summary
Fields inherited from class org.apache.drill.exec.planner.AbstractPartitionDescriptor
locationSuperList, sublistsCreated
Fields inherited from interface org.apache.drill.exec.planner.PartitionDescriptor
PARTITION_BATCH_SIZE
-
Constructor Summary
ConstructorDescriptionHivePartitionDescriptor
(PlannerSettings settings, DrillScanRel scanRel, DrillBuf managedBuffer, String defaultPartitionValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Create sublists of the partition locations, each sublist of size at mostPartitionDescriptor.PARTITION_BATCH_SIZE
org.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.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.Methods inherited from class org.apache.drill.exec.planner.AbstractPartitionDescriptor
createTableScan, iterator, supportsMetadataCachePruning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
HivePartitionDescriptor
public HivePartitionDescriptor(PlannerSettings settings, DrillScanRel scanRel, DrillBuf managedBuffer, String defaultPartitionValue)
-
-
Method Details
-
getPartitionHierarchyIndex
Description copied from interface:PartitionDescriptor
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
Description copied from interface:PartitionDescriptor
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.
-
getMaxHierarchyLevel
public int getMaxHierarchyLevel()Description copied from interface:PartitionDescriptor
Maximum level of partition nesting/ hierarchy supported- Returns:
- maximum supported level number of partition hierarchy
-
getBaseTableLocation
public org.apache.hadoop.fs.Path getBaseTableLocation() -
populatePartitionVectors
public void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer, String> fieldNameMap) Description copied from interface:PartitionDescriptor
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
Description copied from interface:PartitionDescriptor
Method returns the Major type associated with the given column- Parameters:
column
- - column whose type should be determined
-
getIdIfValid
Description copied from interface:PartitionDescriptor
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;
-
createPartitionSublists
protected void createPartitionSublists()Description copied from class:AbstractPartitionDescriptor
Create sublists of the partition locations, each sublist of size at mostPartitionDescriptor.PARTITION_BATCH_SIZE
- Specified by:
createPartitionSublists
in classAbstractPartitionDescriptor
-
createTableScan
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, boolean wasAllPartitionsPruned) throws Exception Description copied from interface:PartitionDescriptor
Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.- Throws:
Exception
-