[ 
https://issues.apache.org/jira/browse/HIVE-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zheng Shao updated HIVE-699:
----------------------------

    Attachment: HIVE-699.1.patch

This patch does the trick. As a side effect, UDAF can take complex arguments 
and return complex values - Hive will convert the object to the corresponding 
Java Class on the fly.

This patch also includes an example UDAF (average) that uses a static inner 
class with 2 fields: mCount and mSum to store the internal state.  The 
terminatePartial function just returns an object of this inner class, and Hive 
is capable of reading the value out using reflection ObjectInspector. Then in 
the reducer, Hive converts a struct with these 2 fields into an object of this 
inner class by using the ReflectionStructObjectInspector(which implements 
SettableStructObjectInspector).


> Make lots of existing ObjectInspectors settable
> -----------------------------------------------
>
>                 Key: HIVE-699
>                 URL: https://issues.apache.org/jira/browse/HIVE-699
>             Project: Hadoop Hive
>          Issue Type: Improvement
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-699.1.patch
>
>
> We should make JavaObjectInspectors, StandardList/Struct/MapObjectInspector, 
> ReflectionObjectInspectors settable.
> This will allow us to make it possible to *write* into Thrift tables, as well 
> as ProtocolBuffer tables in the future.
> This will also allow us to pass complex objects into UDF and receive complex 
> objects from UDF by using ObjectInspectorConverters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to