org.apache.pig.piggybank.evaluation.util
Class Top

java.lang.Object
  extended by org.apache.pig.EvalFunc<DataBag>
      extended by org.apache.pig.piggybank.evaluation.util.Top
All Implemented Interfaces:
Algebraic

Deprecated. Use TOP

@Deprecated
public class Top
extends EvalFunc<DataBag>
implements Algebraic


Nested Class Summary
static class Top.Final
          Deprecated.  
static class Top.Initial
          Deprecated.  
static class Top.Intermed
          Deprecated.  
 
Nested classes/interfaces inherited from class org.apache.pig.EvalFunc
EvalFunc.SchemaType
 
Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
pigLogger, reporter, returnType
 
Constructor Summary
Top()
          Deprecated.  
 
Method Summary
 DataBag exec(Tuple tuple)
          Deprecated. This callback method must be implemented by all subclasses.
 List<FuncSpec> getArgToFuncMapping()
          Deprecated. Allow a UDF to specify type specific implementations of itself.
 String getFinal()
          Deprecated. Get the final function.
 String getInitial()
          Deprecated. Get the initial function.
 String getIntermed()
          Deprecated. Get the intermediate function.
 Schema outputSchema(Schema input)
          Deprecated. Report the schema of the output of this UDF.
protected static void updateTop(PriorityQueue<Tuple> store, int limit, DataBag inputBag)
          Deprecated.  
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Top

public Top()
Deprecated. 
Method Detail

exec

public DataBag exec(Tuple tuple)
             throws IOException
Deprecated. 
Description copied from class: EvalFunc
This callback method must be implemented by all subclasses. This is the method that will be invoked on every Tuple of a given dataset. Since the dataset may be divided up in a variety of ways the programmer should not make assumptions about state that is maintained between invocations of this method.

Specified by:
exec in class EvalFunc<DataBag>
Parameters:
tuple - the Tuple to be processed.
Returns:
result, of type T.
Throws:
IOException

updateTop

protected static void updateTop(PriorityQueue<Tuple> store,
                                int limit,
                                DataBag inputBag)
Deprecated. 

getArgToFuncMapping

public List<FuncSpec> getArgToFuncMapping()
                                   throws FrontendException
Deprecated. 
Description copied from class: EvalFunc
Allow a UDF to specify type specific implementations of itself. For example, an implementation of arithmetic sum might have int and float implementations, since integer arithmetic performs much better than floating point arithmetic. Pig's typechecker will call this method and using the returned list plus the schema of the function's input data, decide which implementation of the UDF to use.

Overrides:
getArgToFuncMapping in class EvalFunc<DataBag>
Returns:
A List containing FuncSpec objects representing the EvalFunc class which can handle the inputs corresponding to the schema in the objects. Each FuncSpec should be constructed with a schema that describes the input for that implementation. For example, the sum function above would return two elements in its list:
  1. FuncSpec(this.getClass().getName(), new Schema(new Schema.FieldSchema(null, DataType.DOUBLE)))
  2. FuncSpec(IntSum.getClass().getName(), new Schema(new Schema.FieldSchema(null, DataType.INTEGER)))
This would indicate that the main implementation is used for doubles, and the special implementation IntSum is used for ints.
Throws:
FrontendException

outputSchema

public Schema outputSchema(Schema input)
Deprecated. 
Description copied from class: EvalFunc
Report the schema of the output of this UDF. Pig will make use of this in error checking, optimization, and planning. The schema of input data to this UDF is provided.

The default implementation interprets the OutputSchema annotation, if one is present. Otherwise, it returns null (no known output schema).

Overrides:
outputSchema in class EvalFunc<DataBag>
Parameters:
input - Schema of the input
Returns:
Schema of the output

getInitial

public String getInitial()
Deprecated. 
Description copied from interface: Algebraic
Get the initial function.

Specified by:
getInitial in interface Algebraic
Returns:
A function name of f_init. f_init should be an eval func. The return type of f_init.exec() has to be Tuple

getIntermed

public String getIntermed()
Deprecated. 
Description copied from interface: Algebraic
Get the intermediate function.

Specified by:
getIntermed in interface Algebraic
Returns:
A function name of f_intermed. f_intermed should be an eval func. The return type of f_intermed.exec() has to be Tuple

getFinal

public String getFinal()
Deprecated. 
Description copied from interface: Algebraic
Get the final function.

Specified by:
getFinal in interface Algebraic
Returns:
A function name of f_final. f_final should be an eval func parametrized by the same datum as the eval func implementing this interface.


Copyright © 2007-2012 The Apache Software Foundation