com.twitter.elephantbird.pig.store
Class RCFilePigStorage

java.lang.Object
  extended by org.apache.pig.LoadFunc
      extended by org.apache.pig.FileInputLoadFunc
          extended by org.apache.pig.builtin.PigStorage
              extended by com.twitter.elephantbird.pig.store.RCFilePigStorage
All Implemented Interfaces:
org.apache.pig.LoadMetadata, org.apache.pig.LoadPushDown, org.apache.pig.OrderedLoadFunc, org.apache.pig.StoreFuncInterface, org.apache.pig.StoreMetadata

public class RCFilePigStorage
extends org.apache.pig.builtin.PigStorage

RCFile version of PigStorage.

Usage:

 register 'libs/*hive-common*.jar;
 register 'libs/*hive-exec*.jar;

 a = load 'input' using RCFileStorage() as (a:int, b:chararray, c:long);

 b = foreach a generate a, TOTUPLE(a, c);
 store b into 'output' using RCFilePigStorage();

 


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pig.LoadPushDown
org.apache.pig.LoadPushDown.OperatorSet, org.apache.pig.LoadPushDown.RequiredField, org.apache.pig.LoadPushDown.RequiredFieldList, org.apache.pig.LoadPushDown.RequiredFieldResponse
 
Field Summary
 
Fields inherited from class org.apache.pig.builtin.PigStorage
caster, in, mLog, mRequiredColumns, schema, signature, writer
 
Constructor Summary
RCFilePigStorage()
           
 
Method Summary
 void checkSchema(org.apache.pig.ResourceSchema s)
           
 org.apache.hadoop.mapreduce.InputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable> getInputFormat()
           
 org.apache.pig.data.Tuple getNext()
           
 org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable> getOutputFormat()
           
 org.apache.pig.LoadPushDown.RequiredFieldResponse pushProjection(org.apache.pig.LoadPushDown.RequiredFieldList requiredFieldList)
           
 void putNext(org.apache.pig.data.Tuple t)
           
 void setLocation(String location, org.apache.hadoop.mapreduce.Job job)
           
 void setStoreLocation(String location, org.apache.hadoop.mapreduce.Job job)
           
 
Methods inherited from class org.apache.pig.builtin.PigStorage
cleanupOnFailure, cleanupOnSuccess, equals, equals, getFeatures, getPartitionKeys, getSchema, getStatistics, hashCode, prepareToRead, prepareToWrite, relToAbsPathForStoreLocation, setPartitionFilter, setStoreFuncUDFContextSignature, setUDFContextSignature, storeSchema, storeStatistics
 
Methods inherited from class org.apache.pig.FileInputLoadFunc
getSplitComparable
 
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

RCFilePigStorage

public RCFilePigStorage()
Method Detail

getInputFormat

public org.apache.hadoop.mapreduce.InputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable> getInputFormat()
Overrides:
getInputFormat in class org.apache.pig.builtin.PigStorage

getOutputFormat

public org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable> getOutputFormat()
Specified by:
getOutputFormat in interface org.apache.pig.StoreFuncInterface
Overrides:
getOutputFormat in class org.apache.pig.builtin.PigStorage

pushProjection

public org.apache.pig.LoadPushDown.RequiredFieldResponse pushProjection(org.apache.pig.LoadPushDown.RequiredFieldList requiredFieldList)
                                                                 throws org.apache.pig.impl.logicalLayer.FrontendException
Specified by:
pushProjection in interface org.apache.pig.LoadPushDown
Overrides:
pushProjection in class org.apache.pig.builtin.PigStorage
Throws:
org.apache.pig.impl.logicalLayer.FrontendException

setLocation

public void setLocation(String location,
                        org.apache.hadoop.mapreduce.Job job)
                 throws IOException
Overrides:
setLocation in class org.apache.pig.builtin.PigStorage
Throws:
IOException

checkSchema

public void checkSchema(org.apache.pig.ResourceSchema s)
                 throws IOException
Specified by:
checkSchema in interface org.apache.pig.StoreFuncInterface
Overrides:
checkSchema in class org.apache.pig.builtin.PigStorage
Throws:
IOException

setStoreLocation

public void setStoreLocation(String location,
                             org.apache.hadoop.mapreduce.Job job)
                      throws IOException
Specified by:
setStoreLocation in interface org.apache.pig.StoreFuncInterface
Overrides:
setStoreLocation in class org.apache.pig.builtin.PigStorage
Throws:
IOException

getNext

public org.apache.pig.data.Tuple getNext()
                                  throws IOException
Overrides:
getNext in class org.apache.pig.builtin.PigStorage
Throws:
IOException

putNext

public void putNext(org.apache.pig.data.Tuple t)
             throws IOException
Specified by:
putNext in interface org.apache.pig.StoreFuncInterface
Overrides:
putNext in class org.apache.pig.builtin.PigStorage
Throws:
IOException


Copyright © 2015 Twitter. All Rights Reserved.