[
https://issues.apache.org/jira/browse/PIG-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005479#comment-14005479
]
Manu Zhang commented on PIG-3943:
---------------------------------
Not really. We found the bug when we were trying to support Pig key value pairs
over NativeTask (https://github.com/intel-hadoop/nativetask) although we later
realized NullableBag is not used as either key or value.
> inconsistency between DefaultAbstractBag readFields and write methods
> ----------------------------------------------------------------------
>
> Key: PIG-3943
> URL: https://issues.apache.org/jira/browse/PIG-3943
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.12.1, 0.13.0
> Reporter: Manu Zhang
>
> By default, NullableBag will write out a DefaultDataBag which inherits the
> write/readFields methods of DefaultAbstractBag. We found the two are
> inconsistent:
> {code}
> public void readFields(DataInput in) throws IOException {
> long size = in.readLong();
> for (long i = 0; i < size; i++) {
> try {
> Object o = sedes.readDatum(in);
> add((Tuple)o);
> } catch (ExecException ee) {
> throw ee;
> }
> }
> }
> public void write(DataOutput out) throws IOException {
> sedes.writeDatum(out, this);
> }
> {code}
> when writing out, the first byte will be one of TINYBAG, SMALLBAG or BAG,
> followed by size which would be a byte, short or long accordingly. Regardless
> of that format, the readFields method directly reads size as a long.
--
This message was sent by Atlassian JIRA
(v6.2#6252)