org.apache.hadoop.hive.ql.exec
Class UDAF

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDAF
Direct Known Subclasses:
NumericUDAF, UDAFPercentile, UDAFWrongArgLengthForTestCase

Deprecated.

@Deprecated
public class UDAF
extends Object

Base class for all User-defined Aggregation Function (UDAF) classes. UDAF classes are REQUIRED to inherit from this class. Required for a UDAF class: 1. Implement the init() method, which reset the status of the aggregation function. 2. Implement a single method called "aggregate" that returns boolean. The method should always return "true" on valid inputs, or the framework will throw an Exception. Following are some examples: public boolean aggregate(double a); public boolean aggregate(int b); public boolean aggregate(double c, double d); 3. Implement a single method called "evaluate" that returns the FINAL aggregation result. "evaluate" should never return "null" or an Exception will be thrown. Following are some examples. public int evaluate(); public long evaluate(); public double evaluate(); public Double evaluate(); public String evaluate(); Optional for a UDAF class (by implementing these 2 methods, the user declares that the UDAF support partial aggregations): 1. Implement a single method called "evaluatePartial" that returns the PARTIAL aggregation result. "evaluatePartial" should never return "null" or an Exception will be thrown. 2. Implement a single method called "aggregatePartial" that takes a PARTIAL aggregation result and returns a boolean. The method should always return "true" on valid inputs, or the framework will throw an Exception. Following are some examples: public int evaluatePartial(); public boolean aggregatePartial(int partial); public String evaluatePartial(); public boolean aggregatePartial(String partial);


Constructor Summary
UDAF()
          Deprecated. The default constructor.
UDAF(UDAFEvaluatorResolver rslv)
          Deprecated. The constructor with a particular type of resolver.
 
Method Summary
 UDAFEvaluatorResolver getResolver()
          Deprecated. Gets the resolver.
 void setResolver(UDAFEvaluatorResolver rslv)
          Deprecated. Sets the resolver.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDAF

public UDAF()
Deprecated. 
The default constructor.


UDAF

public UDAF(UDAFEvaluatorResolver rslv)
Deprecated. 
The constructor with a particular type of resolver.

Method Detail

setResolver

public void setResolver(UDAFEvaluatorResolver rslv)
Deprecated. 
Sets the resolver.

Parameters:
rslv - The method resolver to use for method resolution.

getResolver

public UDAFEvaluatorResolver getResolver()
Deprecated. 
Gets the resolver.



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