[ 
https://issues.apache.org/jira/browse/HIVE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765286#action_12765286
 ] 

Zheng Shao commented on HIVE-655:
---------------------------------

We had an offline design meeting and here are some conclusions:

1. Grammar:
{code}
SELECT myUDTF(expression1, expression2 ...) AS col1, col2, col3
FROM src;
{code}

The column names after AS is required for now.

2. UDTF class hierarchy:
We will have an abstract base class UDTF that have the following interface. The 
interface is simplified from Operator interface.
{code}
abstract ObjectInspector init(ObjectInspector row); // take input row OI and 
output output row OI
abstract void process(Object o); // Get a row and process it
abstract void close(); // Notify that the data stream is ended
final void forward(Object o); // called by UDTF to forward the row that is 
generated
{code}

3. UDTF creation statement. Follow the same way as UDF and UDAF.
{code}
CREATE TEMPORARY FUNCTION myUDAF ..
{code}


> Add support for user defined table generating functions
> -------------------------------------------------------
>
>                 Key: HIVE-655
>                 URL: https://issues.apache.org/jira/browse/HIVE-655
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Raghotham Murthy
>            Assignee: Raghotham Murthy
>
> Provide a way for users to add a table generating function, i.e., functions 
> that generate multiple rows from a single input row. Currently, the only way 
> to do it is via the TRANSFORM clause which requires streaming the data.

-- 
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