public class PathPartitionHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARITITION_FILTER_EXPRESSION |
static java.lang.String |
PARTITION_COLUMNS |
Constructor and Description |
---|
PathPartitionHelper() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getPartitionKeys(java.lang.String location,
org.apache.hadoop.conf.Configuration conf)
Returns the partition keys for a location.
The work is delegated to the PathPartitioner class |
java.util.Map<java.lang.String,java.lang.String> |
getPathPartitionKeyValues(java.lang.String location)
Returns the Partition keys and each key's value for a single location.
That is the location must be something like mytable/partition1=a/partition2=b/myfile. This method will return a map with [partition1='a', partition2='b'] The work is delegated to the PathPartitioner class |
java.util.List<org.apache.hadoop.fs.FileStatus> |
listStatus(org.apache.hadoop.mapreduce.JobContext ctx,
java.lang.Class<? extends LoadFunc> loaderClass,
java.lang.String signature)
This method is called by the FileInputFormat to find the input paths for
which splits should be calculated.
If applyDateRanges == true: Then the HiveRCDateSplitter is used to apply filtering on the input files. Else the default FileInputFormat listStatus method is used. |
void |
setPartitionFilterExpression(java.lang.String partitionFilterExpression,
java.lang.Class<? extends LoadFunc> loaderClass,
java.lang.String signature)
Sets the PARITITION_FILTER_EXPRESSION property in the UDFContext
identified by the loaderClass.
|
void |
setPartitionKeys(java.lang.String location,
org.apache.hadoop.conf.Configuration conf,
java.lang.Class<? extends LoadFunc> loaderClass,
java.lang.String signature)
Reads the partition keys from the location i.e the base directory
|
public static final java.lang.String PARTITION_COLUMNS
public static final java.lang.String PARITITION_FILTER_EXPRESSION
public java.util.Map<java.lang.String,java.lang.String> getPathPartitionKeyValues(java.lang.String location) throws java.io.IOException
location
- java.io.IOException
public java.util.Set<java.lang.String> getPartitionKeys(java.lang.String location, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
location
- String must be the base directory for the partitionsconf
- java.io.IOException
public void setPartitionFilterExpression(java.lang.String partitionFilterExpression, java.lang.Class<? extends LoadFunc> loaderClass, java.lang.String signature) throws java.io.IOException
partitionFilterExpression
- loaderClass
- java.io.IOException
public void setPartitionKeys(java.lang.String location, org.apache.hadoop.conf.Configuration conf, java.lang.Class<? extends LoadFunc> loaderClass, java.lang.String signature) throws java.io.IOException
location
- String must be the base directory for the partitionsconf
- loaderClass
- java.io.IOException
public java.util.List<org.apache.hadoop.fs.FileStatus> listStatus(org.apache.hadoop.mapreduce.JobContext ctx, java.lang.Class<? extends LoadFunc> loaderClass, java.lang.String signature) throws java.io.IOException
ctx
- JobContextloaderClass
- this is chosen to be a subclass of LoadFunc to maintain some
consistency.java.io.IOException
Copyright © 2007-2012 The Apache Software Foundation