org.apache.hadoop.hive.ql.metadata
Class Partition

java.lang.Object
  extended by org.apache.hadoop.hive.ql.metadata.Partition

public class Partition
extends Object

A Hive Table Partition: is a fundamental storage unit within a Table


Constructor Summary
Partition(Table tbl, Map<String,String> partSpec, org.apache.hadoop.fs.Path location)
          Create partition object with the given info.
Partition(Table tbl, Partition tp)
           
 
Method Summary
 List<String> getBucketCols()
           
 int getBucketCount()
          The number of buckets is a property of the partition.
static int getBucketNum(org.apache.hadoop.fs.Path p)
           
 org.apache.hadoop.fs.Path getBucketPath(int bucketNum)
          mapping from bucket number to bucket path
 URI getDataLocation()
           
 Deserializer getDeserializer()
           
 Class<? extends org.apache.hadoop.mapred.InputFormat> getInputFormatClass()
           
 String getName()
           
 Class<? extends HiveOutputFormat> getOutputFormatClass()
           
 org.apache.hadoop.fs.Path getPartitionPath()
           
 org.apache.hadoop.fs.Path[] getPath()
           
 org.apache.hadoop.fs.Path[] getPath(Sample s)
           
 String getProperty(String name)
          getProperty
 Properties getSchema()
           
 LinkedHashMap<String,String> getSpec()
           
 Table getTable()
           
 Partition getTPartition()
           
 List<String> getValues()
           
protected  void initSerDe()
           
 void setInputFormatClass(Class<? extends org.apache.hadoop.mapred.InputFormat> inputFormatClass)
           
 void setOutputFormatClass(Class<?> class1)
           
 void setProperty(String name, String value)
           
 void setSchema(Properties schema)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Partition

public Partition(Table tbl,
                 Partition tp)
          throws HiveException
Throws:
HiveException

Partition

public Partition(Table tbl,
                 Map<String,String> partSpec,
                 org.apache.hadoop.fs.Path location)
          throws HiveException
Create partition object with the given info.

Parameters:
tbl - Table the partition will be in.
partSpec - Partition specifications.
location - Location of the partition, relative to the table.
Throws:
HiveException - Thrown if we could not create the partition.
Method Detail

getTPartition

public Partition getTPartition()
Returns:
the tPartition

getValues

public List<String> getValues()
Returns:
The values of the partition
See Also:
Partition.getValues()

getName

public String getName()

getTable

public Table getTable()

getPath

public org.apache.hadoop.fs.Path[] getPath()

getPartitionPath

public org.apache.hadoop.fs.Path getPartitionPath()

getDataLocation

public final URI getDataLocation()

getDeserializer

public final Deserializer getDeserializer()

setSchema

public void setSchema(Properties schema)
Parameters:
schema - the schema to set

getSchema

public Properties getSchema()

initSerDe

protected void initSerDe()
                  throws HiveException
Throws:
HiveException

setInputFormatClass

public void setInputFormatClass(Class<? extends org.apache.hadoop.mapred.InputFormat> inputFormatClass)
Parameters:
inputFormatClass -

setOutputFormatClass

public void setOutputFormatClass(Class<?> class1)
Parameters:
class1 -

getInputFormatClass

public final Class<? extends org.apache.hadoop.mapred.InputFormat> getInputFormatClass()
                                                                                throws HiveException
Throws:
HiveException

getOutputFormatClass

public final Class<? extends HiveOutputFormat> getOutputFormatClass()
                                                             throws HiveException
Throws:
HiveException

getBucketCount

public int getBucketCount()
The number of buckets is a property of the partition. However - internally we are just storing it as a property of the table as a short term measure.


getBucketCols

public List<String> getBucketCols()

getBucketPath

public org.apache.hadoop.fs.Path getBucketPath(int bucketNum)
mapping from bucket number to bucket path


getBucketNum

public static int getBucketNum(org.apache.hadoop.fs.Path p)

getPath

public org.apache.hadoop.fs.Path[] getPath(Sample s)
                                    throws HiveException
Throws:
HiveException

getSpec

public LinkedHashMap<String,String> getSpec()

toString

public String toString()
Overrides:
toString in class Object

setProperty

public void setProperty(String name,
                        String value)

getProperty

public String getProperty(String name)
getProperty



Copyright © 2009 The Apache Software Foundation