[ 
https://issues.apache.org/jira/browse/PIG-3680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13877886#comment-13877886
 ] 

Nezih Yigitbasi commented on PIG-3680:
--------------------------------------

I have seen that EvalFunc class has a finish() method that can be used for 
cleanup. Initialization can be done in exec() once by keeping track of whether 
we have already initialized or not. So overall it seems that EvalFunc can 
already imitate such a transactional context, except finish() doesn't tell 
whether there was any error during the map phase. 

> A new type of EvalFunc, TransactionalEvalFunc, would be useful
> --------------------------------------------------------------
>
>                 Key: PIG-3680
>                 URL: https://issues.apache.org/jira/browse/PIG-3680
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Nezih Yigitbasi
>            Assignee: Nezih Yigitbasi
>            Priority: Minor
>
> I think a new type of EvalFunc that has some notion of a transactional 
> context would be very useful. This new TransactionalEvalFunc abstract class 
> should have methods like initialize, onSuccess, and onFailure to mark the 
> transaction boundaries. Such EvalFuncs would be useful for interacting with 
> external resources. For example, to delete rows from an existing hbase table 
> such a transactional UDF would be useful. Of course we can imitate this with 
> a StoreFunc, but conceptually StoreFunc's are restricted to writes. If the 
> community thinks this will be useful, I am ready to spend time on this..



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to