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

Cheolsoo Park commented on PIG-3943:
------------------------------------

Thank you Manu for the patch.

Btw, if NullableBag is not used anywhere, can we delete it? I'd prefer removing 
as much dead code as possible since it only causes confusion.

> 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
>         Attachments: PIG-3943.patch
>
>
> 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)

Reply via email to