hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Gates (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIG-1166) A bit change of the interface of Tuple & DataBag ( make the set and append method return this)
Date Thu, 21 Jan 2010 19:16:54 GMT

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

Alan Gates commented on PIG-1166:

Alright, I've reverted the patch.

bq. Aren't we looking at inflicting major pain with 0.7 anyway? 

Yes, but so far only on load and store function writers.  I don't believe we've done anything
to force eval func writers (which vastly outnumber load and store func writers) to recompile
their code.  This is tied to PIG-1017, which I'd love to check in since it will improve memory
management but will also inflict pain (and more than just a recompile) on eval func writers.
 We need to decide whether to inflict pain on both groups in 0.7 or just on load and store
writers in 0.7 and on eval func writers at some later point.  I also think we need criteria
for deciding when we do and don't break backwards compatibility.  I'll start a thread on this
on the pig-dev list.

> A bit change of the interface of Tuple & DataBag ( make the set and append method
return this)
> ----------------------------------------------------------------------------------------------
>                 Key: PIG-1166
>                 URL: https://issues.apache.org/jira/browse/PIG-1166
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Jeff Zhang
>            Assignee: Jeff Zhang
>            Priority: Minor
>         Attachments: Pig_1166.patch
> When people write unit test for UDF, they always need to build a tuple or bag. If we
change the interface of Tuple and DataBag,  make the set and append method return this, it
can decrease the code size.  e.g. Now people have to write the following code to build a Tuple:
> {code}
> Tuple tuple=TupleFactory.getInstance().newTuple(3);
> tuple.set(0,"item_0");
> tuple.set(1,"item_1");
> tuple.set(2,"item_2");
> {code}
> If we change the interface,  make the set and append method return this, we can rewrite
the above code like this:
> {code}
> Tuple tuple=TupleFactory.getInstance().newTuple(3);
> tuple.set(0,"item_0").set(1,"item_1").set(2,"item_2");
> {code}
> This interface change won't have back compatibility problem and I think there's no performance
problem too.

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

View raw message