[
https://issues.apache.org/jira/browse/AVRO-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14095982#comment-14095982
]
Sean Jensen-Grey commented on AVRO-959:
---------------------------------------
As a note, this requires reading the entire Avro into memory which could
potentially be 10s of gigabytes or larger. Only works for small Avro files.
> python implementation calls seek on input, unable to read avros from a stream
> -----------------------------------------------------------------------------
>
> Key: AVRO-959
> URL: https://issues.apache.org/jira/browse/AVRO-959
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.6.1
> Reporter: Sean Jensen-Grey
>
> The python implementation of Avro calls seek on the input file handle which
> precludes it from being a stream (stdin, hadoop streaming, etc)
> {code}
> ack -a -i seek
> src/avro/datafile.py
> 109: # seek to the end of the file and prepare for writing
> 110: writer.seek(0, 2)
> 190: DataFileReader.seek(long). Forces the end of the current block,
> 261: self.reader.seek(0, 2)
> 263: self.reader.seek(remember_pos)
> 270: # seek to the beginning of the file to get magic block
> 271: self.reader.seek(0, 0)
> 316: return True. Otherwise, seek back to where we started and return
> False.
> 320: self.reader.seek(-SYNC_SIZE, 1)
> src/avro/io.py
> 148: reader is a Python object on which we can call read, seek, and tell.
> 267: self.reader.seek(self.reader.tell() + n)
> src/avro/txipc.py
> 217: request.content.seek(0, 0)
> test/test_io.py
> 137: writer.seek(0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)