Uploaded image for project: 'Avro'
  1. Avro
  2. AVRO-155

Make avro.io.DataFileReader iterable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: python
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When reading records out of a file object container using the Python bindings, it would be great to be able to say:

      for record in dfr:
        <do something with record>
      

      There's already a "next()" method defined on the DataFileReader, but the _iter_ method is not defined and we "return None" instead of "raise StopIteration" when out of records.

        Attachments

        1. AVRO-155_with_test.patch
          1 kB
          Sharad Agarwal
        2. AVRO-155.patch
          0.7 kB
          Jeff Hammerbacher

          Activity

            People

            • Assignee:
              hammer Jeff Hammerbacher
              Reporter:
              hammer Jeff Hammerbacher
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: