Class HiveColumnarStorage

  extended by org.apache.pig.LoadFunc
      extended by org.apache.pig.FileInputLoadFunc
          extended by org.apache.pig.builtin.PigStorage
              extended by
All Implemented Interfaces:
LoadMetadata, LoadPushDown, OrderedLoadFunc, OverwritableStoreFunc, StoreFuncInterface, StoreMetadata

public class HiveColumnarStorage
extends PigStorage

Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pig.LoadPushDown
LoadPushDown.OperatorSet, LoadPushDown.RequiredField, LoadPushDown.RequiredFieldList, LoadPushDown.RequiredFieldResponse
Field Summary
Fields inherited from class org.apache.pig.builtin.PigStorage
caster, in, mLog, mRequiredColumns, schema, signature, writer
Constructor Summary
Method Summary
 void checkSchema(ResourceSchema s)
          Set the schema for data to be stored.
 org.apache.hadoop.mapreduce.OutputFormat getOutputFormat()
          Return the OutputFormat associated with StoreFuncInterface.
 void putField(OutputStream out, Object field)
 void putNext(Tuple t)
          Write a tuple to the data store.
 void setStoreLocation(String location, org.apache.hadoop.mapreduce.Job job)
          Communicate to the storer the location where the data needs to be stored.
Methods inherited from class org.apache.pig.builtin.PigStorage
cleanupOnFailure, cleanupOnSuccess, cleanupOutput, equals, equals, getFeatures, getInputFormat, getNext, getPartitionKeys, getSchema, getStatistics, hashCode, prepareToRead, prepareToWrite, pushProjection, readField, relToAbsPathForStoreLocation, setLocation, setPartitionFilter, setStoreFuncUDFContextSignature, setUDFContextSignature, shouldOverwrite, storeSchema, storeStatistics
Methods inherited from class org.apache.pig.FileInputLoadFunc
Methods inherited from class org.apache.pig.LoadFunc
getAbsolutePath, getLoadCaster, getPathStrings, join, relativeToAbsolutePath, warn
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public HiveColumnarStorage()
Method Detail


public org.apache.hadoop.mapreduce.OutputFormat getOutputFormat()
Description copied from interface: StoreFuncInterface
Return the OutputFormat associated with StoreFuncInterface. This will be called on the front end during planning and on the backend during execution.

Specified by:
getOutputFormat in interface StoreFuncInterface
getOutputFormat in class PigStorage
the OutputFormat associated with StoreFuncInterface


public void setStoreLocation(String location,
                             org.apache.hadoop.mapreduce.Job job)
                      throws IOException
Description copied from interface: StoreFuncInterface
Communicate to the storer the location where the data needs to be stored. The location string passed to the StoreFuncInterface here is the return value of StoreFuncInterface.relToAbsPathForStoreLocation(String, Path) This method will be called in the frontend and backend multiple times. Implementations should bear in mind that this method is called multiple times and should ensure there are no inconsistent side effects due to the multiple calls. StoreFuncInterface.checkSchema(ResourceSchema) will be called before any call to StoreFuncInterface.setStoreLocation(String, Job).

Specified by:
setStoreLocation in interface StoreFuncInterface
setStoreLocation in class PigStorage
location - Location returned by StoreFuncInterface.relToAbsPathForStoreLocation(String, Path)
job - The Job object
IOException - if the location is not valid.


public void checkSchema(ResourceSchema s)
                 throws IOException
Description copied from interface: StoreFuncInterface
Set the schema for data to be stored. This will be called on the front end during planning if the store is associated with a schema. A Store function should implement this function to check that a given schema is acceptable to it. For example, it can check that the correct partition keys are included; a storage function to be written directly to an OutputFormat can make sure the schema will translate in a well defined way.

Specified by:
checkSchema in interface StoreFuncInterface
checkSchema in class PigStorage
s - to be checked
IOException - if this schema is not acceptable. It should include a detailed error message indicating what is wrong with the schema.


public void putNext(Tuple t)
             throws IOException
Description copied from interface: StoreFuncInterface
Write a tuple to the data store.

Specified by:
putNext in interface StoreFuncInterface
putNext in class PigStorage
t - the tuple to store.
IOException - if an exception occurs during the write


public void putField(OutputStream out,
                     Object field)
              throws IOException

Copyright © 2007-2012 The Apache Software Foundation