public class FileSystemPartitionDescriptor extends AbstractPartitionDescriptor
locationSuperList, sublistsCreated
PARTITION_BATCH_SIZE
Constructor and Description |
---|
FileSystemPartitionDescriptor(PlannerSettings settings,
org.apache.calcite.rel.core.TableScan scanRel) |
Modifier and Type | Method and Description |
---|---|
protected void |
createPartitionSublists()
Create sublists of the partition locations, each sublist of size
at most
PartitionDescriptor.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 file
|
org.apache.hadoop.fs.Path |
getBaseTableLocation() |
protected org.apache.commons.lang3.tuple.Pair<Collection<org.apache.hadoop.fs.Path>,Boolean> |
getFileLocationsAndStatus() |
Integer |
getIdIfValid(String name)
Check to see if the name is a partition name.
|
int |
getMaxHierarchyLevel()
Maximum level of partition nesting/ hierarchy supported
|
String |
getName(int index) |
int |
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") => 2
|
DrillTable |
getTable() |
TypeProtos.MajorType |
getVectorType(SchemaPath column,
PlannerSettings plannerSettings)
Method returns the Major type associated with the given column
|
boolean |
isPartitionName(String name)
Given a column name return boolean to indicate if its a partition column or not
|
void |
populatePartitionVectors(ValueVector[] vectors,
List<PartitionLocation> partitions,
BitSet partitionColumnBitSet,
Map<Integer,String> fieldNameMap)
Creates an in memory representation of all the partitions.
|
boolean |
supportsMetadataCachePruning() |
iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public FileSystemPartitionDescriptor(PlannerSettings settings, org.apache.calcite.rel.core.TableScan scanRel)
public int getPartitionHierarchyIndex(String partitionName)
PartitionDescriptor
partitionName
- Partition namepublic boolean isPartitionName(String name)
PartitionDescriptor
name
- of Partitionpublic Integer getIdIfValid(String name)
PartitionDescriptor
name
- The field name you want to compare to partition names.public int getMaxHierarchyLevel()
PartitionDescriptor
public DrillTable getTable()
public void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer,String> fieldNameMap)
PartitionDescriptor
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 namepublic TypeProtos.MajorType getVectorType(SchemaPath column, PlannerSettings plannerSettings)
PartitionDescriptor
column
- - column whose type should be determinedpublic String getName(int index)
public org.apache.hadoop.fs.Path getBaseTableLocation()
protected void createPartitionSublists()
AbstractPartitionDescriptor
PartitionDescriptor.PARTITION_BATCH_SIZE
createPartitionSublists
in class AbstractPartitionDescriptor
protected org.apache.commons.lang3.tuple.Pair<Collection<org.apache.hadoop.fs.Path>,Boolean> getFileLocationsAndStatus()
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitionLocation, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) throws Exception
PartitionDescriptor
createTableScan
in interface PartitionDescriptor
createTableScan
in class AbstractPartitionDescriptor
Exception
public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitionLocation, boolean wasAllPartitionsPruned) throws Exception
PartitionDescriptor
Exception
public boolean supportsMetadataCachePruning()
supportsMetadataCachePruning
in interface PartitionDescriptor
supportsMetadataCachePruning
in class AbstractPartitionDescriptor
Copyright © 2022 The Apache Software Foundation. All rights reserved.