Package org.apache.drill.exec.planner
Class ParquetPartitionDescriptor
java.lang.Object
org.apache.drill.exec.planner.AbstractPartitionDescriptor
org.apache.drill.exec.planner.ParquetPartitionDescriptor
- All Implemented Interfaces:
Iterable<List<PartitionLocation>>
,PartitionDescriptor
PartitionDescriptor that describes partitions based on column names instead of directory structure
-
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
-
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> 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.TableScan
createTableScan
(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.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
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
-
ParquetPartitionDescriptor
-
-
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.
-
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;
-
getMaxHierarchyLevel
public int getMaxHierarchyLevel()Description copied from interface:PartitionDescriptor
Maximum level of partition nesting/ hierarchy supported- Returns:
- maximum supported level number of partition hierarchy
-
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
-
getBaseTableLocation
public org.apache.hadoop.fs.Path getBaseTableLocation() -
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:PartitionDescriptor
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- Specified by:
createTableScan
in interfacePartitionDescriptor
- Overrides:
createTableScan
in classAbstractPartitionDescriptor
- Throws:
Exception
-
createTableScan
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitionLocation, 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
-
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
-