You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ben Walsh (JIRA)" <ji...@apache.org> on 2013/08/21 15:31:51 UTC

[jira] [Updated] (AVRO-1364) Avro-C reader ignores final block in file

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

Ben Walsh updated AVRO-1364:
----------------------------

    Description: 
The Avro-C reader can ignore the final block(s) in a file. It buffers the final block(s) to memory then detects EOF and returns. It doesn't finish reading from the buffer before returning EOF.

This bug was introduced in AVRO-1238 (https://issues.apache.org/jira/browse/AVRO-1238).

To reproduce:

{code}
cd avro/lang/c/tests

# copy file with 1 block
cp avro-1238-good.avro two-blocks.avro

# copy block to make file with 2 blocks
xxd -c1 -p avro-1238-good.avro | tail -22 | xxd -r -p >>two-blocks.avro

# should return 2*2 = 4 records:
../build/src/avrocat two-blocks.avro 
null
{"int": 100}

{code}


  was:
The Avro-C reader can ignore the final block(s) in a file. It buffers the final block(s) to memory then detects EOF and returns. It doesn't finish reading from the buffer before returning EOF.

This bug was introduced in AVRO-1238 (https://issues.apache.org/jira/browse/AVRO-1238).

To reproduce:

$ cd avro/lang/c/tests

# copy file with 1 block
$ cp avro-1238-good.avro two-blocks.avro

# copy block to make file with 2 blocks
$ xxd -c1 -p avro-1238-good.avro | tail -22 | xxd -r -p >>two-blocks.avro

# should return 2*2 = 4 records:
$ ../build/src/avrocat two-blocks.avro 
null
{"int": 100}


    
> Avro-C reader ignores final block in file
> -----------------------------------------
>
>                 Key: AVRO-1364
>                 URL: https://issues.apache.org/jira/browse/AVRO-1364
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.7.5
>            Reporter: Ben Walsh
>
> The Avro-C reader can ignore the final block(s) in a file. It buffers the final block(s) to memory then detects EOF and returns. It doesn't finish reading from the buffer before returning EOF.
> This bug was introduced in AVRO-1238 (https://issues.apache.org/jira/browse/AVRO-1238).
> To reproduce:
> {code}
> cd avro/lang/c/tests
> # copy file with 1 block
> cp avro-1238-good.avro two-blocks.avro
> # copy block to make file with 2 blocks
> xxd -c1 -p avro-1238-good.avro | tail -22 | xxd -r -p >>two-blocks.avro
> # should return 2*2 = 4 records:
> ../build/src/avrocat two-blocks.avro 
> null
> {"int": 100}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira