You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Jeff Hammerbacher (JIRA)" <ji...@apache.org> on 2009/10/19 10:54:31 UTC

[jira] Created: (AVRO-155) Make avro.io.DataFileReader iterable

Make avro.io.DataFileReader iterable
------------------------------------

                 Key: AVRO-155
                 URL: https://issues.apache.org/jira/browse/AVRO-155
             Project: Avro
          Issue Type: Improvement
          Components: python
            Reporter: Jeff Hammerbacher


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

{code}
for record in dfr:
  <do something with record>
{code}

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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767284#action_12767284 ] 

Jeff Hammerbacher commented on AVRO-155:
----------------------------------------

Thanks Sharad! Feel free to commit or ignore as you see fit.

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>         Attachments: AVRO-155.patch, AVRO-155_with_test.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting reassigned AVRO-155:
---------------------------------

    Assignee: Jeff Hammerbacher

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>             Fix For: 1.3.0
>
>         Attachments: AVRO-155.patch, AVRO-155_with_test.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Hammerbacher updated AVRO-155:
-----------------------------------

    Attachment: AVRO-155.patch

Make DataFileReader iterable. Note that I didn't run the tests because I only have Java 5 on my box (thanks, Apple). If you have Java 6 and can check that tests pass, that would be great. If folks rely on next() returning "None" in a test, then some things will break.

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>         Attachments: AVRO-155.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Sharad Agarwal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sharad Agarwal updated AVRO-155:
--------------------------------

    Attachment: AVRO-155_with_test.patch

Added the test case.

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>         Attachments: AVRO-155.patch, AVRO-155_with_test.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Sharad Agarwal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sharad Agarwal resolved AVRO-155.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0
     Hadoop Flags: [Reviewed]

I just committed this. Thanks Jeff.

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>             Fix For: 1.3.0
>
>         Attachments: AVRO-155.patch, AVRO-155_with_test.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-155) Make avro.io.DataFileReader iterable

Posted by "Sharad Agarwal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767280#action_12767280 ] 

Sharad Agarwal commented on AVRO-155:
-------------------------------------

ant test worked fine with the patch.

> Make avro.io.DataFileReader iterable
> ------------------------------------
>
>                 Key: AVRO-155
>                 URL: https://issues.apache.org/jira/browse/AVRO-155
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>         Attachments: AVRO-155.patch, AVRO-155_with_test.patch
>
>
> When reading records out of a file object container using the Python bindings, it would be great to be able to say:
> {code}
> for record in dfr:
>   <do something with record>
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.