[ https://issues.apache.org/jira/browse/PIG-2066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253209#comment-13253209 ]
Jonathan Coveney commented on PIG-2066: --------------------------------------- I agree, so here is a patch! I probably need to add more tests. Incidentally, I went ahead and used "IsEmpty" as my guinea pig, so this patch gives us https://issues.apache.org/jira/browse/PIG-2065. It took a bit to grok the relationship between POUserFunc and POForEach, but it doesn't touch that much code. Basically, it keeps track of all of the UDFs that have terminated early, and if they all terminate early, it terminates early. > Accumulators should be able to early-terminate > ---------------------------------------------- > > Key: PIG-2066 > URL: https://issues.apache.org/jira/browse/PIG-2066 > Project: Pig > Issue Type: New Feature > Reporter: Dmitriy V. Ryaboy > > Accumulators are currently forced to process the whole bag; getValue() is > called at the very end. > Early termination is a handy feature to be able to use (for IsEmpty, for > example). > We can add this as a new interface extending Accumulator. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira