Kengo Seki created AVRO-2426:
--------------------------------

             Summary: Add zstd support to Python bindings
                 Key: AVRO-2426
                 URL: https://issues.apache.org/jira/browse/AVRO-2426
             Project: Apache Avro
          Issue Type: New Feature
          Components: python
            Reporter: Kengo Seki
            Assignee: Kengo Seki


Python bindings don't seem to support zstd codec for now.

{code}
$ java -jar avro-tools-1.9.0.jar getmeta sample.avro

(snip)

avro.codec      zstandard
$ ipython

(snip)

In [1]: from avro.schema import Parse

In [2]: with open("sample.avsc") as f:
   ...:     s = Parse(f.read())
   ...:

In [3]: from avro.datafile import DataFileReader

In [4]: from avro.io import DatumReader

In [5]: with open("sample.avro", "rb") as f:
   ...:     d = DataFileReader(f, DatumReader())
   ...:
---------------------------------------------------------------------------
DataFileException                         Traceback (most recent call last)
<ipython-input-5-ed3bb922f287> in <module>
      1 with open("sample.avro", "rb") as f:
----> 2     d = DataFileReader(f, DatumReader())
      3

~/repo/avro/lang/py3/avro/datafile.py in __init__(self, reader, datum_reader)
    358       self.codec = avro_codec_raw.decode('utf-8')
    359     if self.codec not in VALID_CODECS:
--> 360       raise DataFileException('Unknown codec: %s.' % self.codec)
    361
    362     self._file_length = self._GetInputFileLength()

DataFileException: Unknown codec: zstandard.
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to