avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Hammerbacher <ham...@cloudera.com>
Subject Using file object containers from Python
Date Tue, 20 Oct 2009 10:25:29 GMT
Hey,

So I've been playing with Avro the past few days through the Python bindings
(thanks, Sharad!). I was able to get serialization and deserialization
working in a reasonably hacky fashion when a file is only opened and written
once (see
http://github.com/hammer/avro-rpc-quickstart/blob/master/src/main/python/serialize_message.py
).

When I tried to serialize data to a file, close the file, and then open it
up again, serialize another value, and close again, I am no longer able to
read it back successfully (see
http://github.com/hammer/avro-rpc-quickstart/blob/master/src/main/python/serialize_message.py.broken).
I realize that the metadata gets written in the footer, and i tried to play
around with sync() and seek() calls, but I wasn't able to figure out the
correct mechanism.

So: what's the proper way to crack open an existing file object container
and append some additional values? I'd particularly appreciate a
demonstration in Python.

Thanks,
Jeff

Mime
View raw message