You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Yiping Han (JIRA)" <ji...@apache.org> on 2009/01/07 20:02:44 UTC

[jira] Created: (PIG-601) Add finalize() interface to UDF

Add finalize() interface to UDF
-------------------------------

                 Key: PIG-601
                 URL: https://issues.apache.org/jira/browse/PIG-601
             Project: Pig
          Issue Type: New Feature
          Components: impl
            Reporter: Yiping Han


I would like to have a finalize() method to UDF, which will be called when no more inputs and the UDF will be killed. The finalize() method should allow to generate extra output, which in many cases could benefit aggregations.

There are couple of application that can benefit from this feature.

One of the example is, in some UDFs, I need to open some resource(i. e. local file) and when the task finishes, I need to close the resource.

Another example is, in one of my application, I do statistics for a list of categories and I need to generate a summary category and attach to the end of the table. With the finalize method, I could achieve this in an efficient and neat way.

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


[jira] Resolved: (PIG-601) Add finalize() interface to UDF

Posted by "Olga Natkovich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Natkovich resolved PIG-601.
--------------------------------

    Resolution: Fixed

Both EvalFunc and StoreFunc have finish() method that is called bythe framework when no more data will be given to the UDF. On the load side, UDF itself decided when it is done so such functionality is not needed. Please, reopen if I misunderstood your intent.

> Add finalize() interface to UDF
> -------------------------------
>
>                 Key: PIG-601
>                 URL: https://issues.apache.org/jira/browse/PIG-601
>             Project: Pig
>          Issue Type: New Feature
>          Components: impl
>            Reporter: Yiping Han
>
> I would like to have a finalize() method to UDF, which will be called when no more inputs and the UDF will be killed. The finalize() method should allow to generate extra output, which in many cases could benefit aggregations.
> There are couple of application that can benefit from this feature.
> One of the example is, in some UDFs, I need to open some resource(i. e. local file) and when the task finishes, I need to close the resource.
> Another example is, in one of my application, I do statistics for a list of categories and I need to generate a summary category and attach to the end of the table. With the finalize method, I could achieve this in an efficient and neat way.

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