public class PathPartitionHelper extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static String | PARITITION_FILTER_EXPRESSION | 
| static String | PARTITION_COLUMNS | 
| Constructor and Description | 
|---|
| PathPartitionHelper() | 
| Modifier and Type | Method and Description | 
|---|---|
| Set<String> | getPartitionKeys(String location,
                org.apache.hadoop.conf.Configuration conf)Returns the partition keys for a location. The work is delegated to the PathPartitioner class | 
| Map<String,String> | getPathPartitionKeyValues(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 | 
| List<org.apache.hadoop.fs.FileStatus> | listStatus(org.apache.hadoop.mapreduce.JobContext ctx,
          Class<? extends LoadFunc> loaderClass,
          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(String partitionFilterExpression,
                            Class<? extends LoadFunc> loaderClass,
                            String signature)Sets the PARITITION_FILTER_EXPRESSION property in the UDFContext
 identified by the loaderClass. | 
| void | setPartitionKeys(String location,
                org.apache.hadoop.conf.Configuration conf,
                Class<? extends LoadFunc> loaderClass,
                String signature)Reads the partition keys from the location i.e the base directory | 
public static final String PARTITION_COLUMNS
public static final String PARITITION_FILTER_EXPRESSION
public Map<String,String> getPathPartitionKeyValues(String location) throws IOException
location - IOExceptionpublic Set<String> getPartitionKeys(String location, org.apache.hadoop.conf.Configuration conf) throws IOException
location - String must be the base directory for the partitionsconf - IOExceptionpublic void setPartitionFilterExpression(String partitionFilterExpression, Class<? extends LoadFunc> loaderClass, String signature) throws IOException
partitionFilterExpression - loaderClass - IOExceptionpublic void setPartitionKeys(String location, org.apache.hadoop.conf.Configuration conf, Class<? extends LoadFunc> loaderClass, String signature) throws IOException
location - String must be the base directory for the partitionsconf - loaderClass - IOExceptionpublic List<org.apache.hadoop.fs.FileStatus> listStatus(org.apache.hadoop.mapreduce.JobContext ctx, Class<? extends LoadFunc> loaderClass, String signature) throws IOException
ctx - JobContextloaderClass - this is chosen to be a subclass of LoadFunc to maintain some
            consistency.IOExceptionCopyright © 2007-2017 The Apache Software Foundation