pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manu Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-3943) inconsistency between DefaultAbstractBag readFields and write methods
Date Thu, 22 May 2014 02:54:38 GMT

     [ https://issues.apache.org/jira/browse/PIG-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manu Zhang updated PIG-3943:
----------------------------

    Attachment: PIG-3943.patch

patch attached

> 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)

Mime
View raw message