You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2009/05/05 03:17:30 UTC
[jira] Issue Comment Edited: (HIVE-45) Hive: GenericUDF and support
of complex object
[ https://issues.apache.org/jira/browse/HIVE-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655547#action_12655547 ]
Zheng Shao edited comment on HIVE-45 at 5/4/09 6:15 PM:
--------------------------------------------------------
Please see HIVE-164 for the interface of GenericUDF.
was (Author: zshao):
{code}
public abstract class UDFTemplate {
/**
* Evaluate the template function given the parameters row and rowInspector.
* NOTE: If the ObjectInspectors of the parameters do not change, then result.oi cannot change as well.
* @param parameters the input parameters to the template function
* @param result result.o and result.oi will be set inside the method.
*/
public abstract void evaluate(List<InspectableObject> parameters, InspectableObject result) throws HiveException;
/**
* Evaluate the result's ObjectInspector given the parameters' ObjectInspectors.
* ObjectInspector encapsulates information about the object type and the methods to access the internal fields inside the object.
* @param parameterInspectors the input parameters' ObjectInspectors to the template function
* @return null if the template function does not accept such a list of parameters; otherwise the same
* ObjectInspector as returned in result.oi in evaluate(...).
*/
public abstract ObjectInspector evaluateInspector(List<ObjectInspector> parameterInspectors) throws HiveException;
}
{code}
> Hive: GenericUDF and support of complex object
> ----------------------------------------------
>
> Key: HIVE-45
> URL: https://issues.apache.org/jira/browse/HIVE-45
> Project: Hadoop Hive
> Issue Type: Bug
> Components: Query Processor
> Reporter: Zheng Shao
> Assignee: Zheng Shao
> Fix For: 0.4.0
>
>
> GenericUDF are more powerful than UDF in the following ways:
> 1. It can accept arguments of complex types, and return complex types.
> 2. It can accept variable length of arguments.
> 3. It can accept an infinite number of function signature - for example, it's easy to write a GenericUDF that accepts array<int>, array<array<int>> and so on (arbitrary levels of nesting).
> 4. It can do short-circuit evaluations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.