org.apache.hcatalog.pig
Class HCatBaseStorer
java.lang.Object
org.apache.pig.StoreFunc
org.apache.hcatalog.pig.HCatBaseStorer
- All Implemented Interfaces:
- org.apache.pig.StoreFuncInterface, org.apache.pig.StoreMetadata
- Direct Known Subclasses:
- HCatEximStorer, HCatStorer
public abstract class HCatBaseStorer
- extends org.apache.pig.StoreFunc
- implements org.apache.pig.StoreMetadata
Base class for HCatStorer and HCatEximStorer
Constructor Summary |
HCatBaseStorer(java.lang.String partSpecs,
java.lang.String schema)
|
Methods inherited from class org.apache.pig.StoreFunc |
cleanupOnFailureImpl, getOutputFormat, setStoreLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.pig.StoreMetadata |
storeSchema |
COMPUTED_OUTPUT_SCHEMA
protected static final java.lang.String COMPUTED_OUTPUT_SCHEMA
- See Also:
- Constant Field Values
partitions
protected final java.util.Map<java.lang.String,java.lang.String> partitions
pigSchema
protected org.apache.pig.impl.logicalLayer.schema.Schema pigSchema
computedSchema
protected HCatSchema computedSchema
PIG_SCHEMA
protected static final java.lang.String PIG_SCHEMA
- See Also:
- Constant Field Values
sign
protected java.lang.String sign
HCatBaseStorer
public HCatBaseStorer(java.lang.String partSpecs,
java.lang.String schema)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkSchema
public void checkSchema(org.apache.pig.ResourceSchema resourceSchema)
throws java.io.IOException
- Specified by:
checkSchema
in interface org.apache.pig.StoreFuncInterface
- Overrides:
checkSchema
in class org.apache.pig.StoreFunc
- Throws:
java.io.IOException
convertPigSchemaToHCatSchema
protected HCatSchema convertPigSchemaToHCatSchema(org.apache.pig.impl.logicalLayer.schema.Schema pigSchema,
HCatSchema tableSchema)
throws org.apache.pig.impl.logicalLayer.FrontendException
- Constructs HCatSchema from pigSchema. Passed tableSchema is the existing
schema of the table in metastore.
- Throws:
org.apache.pig.impl.logicalLayer.FrontendException
prepareToWrite
public void prepareToWrite(org.apache.hadoop.mapreduce.RecordWriter writer)
throws java.io.IOException
- Specified by:
prepareToWrite
in interface org.apache.pig.StoreFuncInterface
- Specified by:
prepareToWrite
in class org.apache.pig.StoreFunc
- Throws:
java.io.IOException
putNext
public void putNext(org.apache.pig.data.Tuple tuple)
throws java.io.IOException
- Specified by:
putNext
in interface org.apache.pig.StoreFuncInterface
- Specified by:
putNext
in class org.apache.pig.StoreFunc
- Throws:
java.io.IOException
relToAbsPathForStoreLocation
public java.lang.String relToAbsPathForStoreLocation(java.lang.String location,
org.apache.hadoop.fs.Path curDir)
throws java.io.IOException
- Specified by:
relToAbsPathForStoreLocation
in interface org.apache.pig.StoreFuncInterface
- Overrides:
relToAbsPathForStoreLocation
in class org.apache.pig.StoreFunc
- Throws:
java.io.IOException
setStoreFuncUDFContextSignature
public void setStoreFuncUDFContextSignature(java.lang.String signature)
- Specified by:
setStoreFuncUDFContextSignature
in interface org.apache.pig.StoreFuncInterface
- Overrides:
setStoreFuncUDFContextSignature
in class org.apache.pig.StoreFunc
doSchemaValidations
protected void doSchemaValidations(org.apache.pig.impl.logicalLayer.schema.Schema pigSchema,
HCatSchema tblSchema)
throws org.apache.pig.impl.logicalLayer.FrontendException,
HCatException
- Throws:
org.apache.pig.impl.logicalLayer.FrontendException
HCatException
cleanupOnFailure
public void cleanupOnFailure(java.lang.String location,
org.apache.hadoop.mapreduce.Job job)
throws java.io.IOException
- Specified by:
cleanupOnFailure
in interface org.apache.pig.StoreFuncInterface
- Overrides:
cleanupOnFailure
in class org.apache.pig.StoreFunc
- Throws:
java.io.IOException
storeStatistics
public void storeStatistics(org.apache.pig.ResourceStatistics stats,
java.lang.String arg1,
org.apache.hadoop.mapreduce.Job job)
throws java.io.IOException
- Specified by:
storeStatistics
in interface org.apache.pig.StoreMetadata
- Throws:
java.io.IOException