org.apache.hadoop.hive.ql.udf.generic
Class GenericUDTFStack

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
      extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDTFStack

public class GenericUDTFStack
extends GenericUDTF

Takes a row of size k of data and splits it into n rows of data. For example, if n is 3 then the rest of the arguments are split in order into 3 rows, each of which has k/3 columns in it (the first emitted row has the first k/3, the second has the second, etc). If n does not divide k then the remaining columns are padded with NULLs.


Constructor Summary
GenericUDTFStack()
           
 
Method Summary
 void close()
          Called to notify the UDTF that there are no more rows to process.
 StructObjectInspector initialize(ObjectInspector[] args)
          Initialize this GenericUDTF.
 void process(Object[] args)
          Give a set of arguments for the UDTF to process.
 String toString()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
configure, initialize, setCollector
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericUDTFStack

public GenericUDTFStack()
Method Detail

close

public void close()
           throws HiveException
Description copied from class: GenericUDTF
Called to notify the UDTF that there are no more rows to process. Clean up code or additional forward() calls can be made here.

Specified by:
close in class GenericUDTF
Throws:
HiveException

initialize

public StructObjectInspector initialize(ObjectInspector[] args)
                                 throws UDFArgumentException
Description copied from class: GenericUDTF
Initialize this GenericUDTF. This will be called only once per instance.

Overrides:
initialize in class GenericUDTF
Parameters:
args - An array of ObjectInspectors for the arguments
Returns:
A StructObjectInspector for output. The output struct represents a row of the table where the fields of the stuct are the columns. The field names are unimportant as they will be overridden by user supplied column aliases.
Throws:
UDFArgumentException

process

public void process(Object[] args)
             throws HiveException,
                    UDFArgumentException
Description copied from class: GenericUDTF
Give a set of arguments for the UDTF to process.

Specified by:
process in class GenericUDTF
Parameters:
args - object array of arguments
Throws:
HiveException
UDFArgumentException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 The Apache Software Foundation. All rights reserved.