Avro
  1. Avro
  2. AVRO-836

Have an "avro" command line utility to display and write Avro files

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: python
    • Hadoop Flags:
      Reviewed

      Description

      Following email conversation, this is a port of avrocat to the avro code base.

      1. AVRO-836.diff
        16 kB
        Miki Tebeka
      2. AVRO-836.diff
        16 kB
        Miki Tebeka
      3. AVRO-836.diff
        16 kB
        Miki Tebeka

        Activity

        Hide
        Miki Tebeka added a comment -

        Patch for "avro" command line utility.

        Show
        Miki Tebeka added a comment - Patch for "avro" command line utility.
        Hide
        Philip Zeyliger added a comment -

        This looks great to me. Some comments:

        1) Are you sure you want to put avro into scripts/? Seems like src/avro would be just as good a place.

        2) Usage help:

        [1]air::py(129882)$PYTHONPATH=src ./scripts/avro
        error: You must specify `cat` or `write`
        [1]air::py(129888)$PYTHONPATH=src ./scripts/avro write
        error: No schema specified

        Have you considered spitting out a more useful message here? You can get optparse to spit out fairly nice error messages. It's hard to figure out what's required and how to use it.

        Thanks!

        Show
        Philip Zeyliger added a comment - This looks great to me. Some comments: 1) Are you sure you want to put avro into scripts/? Seems like src/avro would be just as good a place. 2) Usage help: [1] air::py(129882)$PYTHONPATH=src ./scripts/avro error: You must specify `cat` or `write` [1] air::py(129888)$PYTHONPATH=src ./scripts/avro write error: No schema specified Have you considered spitting out a more useful message here? You can get optparse to spit out fairly nice error messages. It's hard to figure out what's required and how to use it. Thanks!
        Hide
        Miki Tebeka added a comment -

        1.
        That's the usual convention in Python projects. However if this is a problem I'll move it.

        2.
        I agree, I'll have the script emit a better help message when no arguments are given.

        Show
        Miki Tebeka added a comment - 1. That's the usual convention in Python projects. However if this is a problem I'll move it. 2. I agree, I'll have the script emit a better help message when no arguments are given.
        Hide
        Philip Zeyliger added a comment -

        1) ok

        2) Cool; looking forward to a new patch.

        Show
        Philip Zeyliger added a comment - 1) ok 2) Cool; looking forward to a new patch.
        Hide
        Miki Tebeka added a comment -

        OK move or OK leave it at scripts?

        Show
        Miki Tebeka added a comment - OK move or OK leave it at scripts?
        Hide
        Philip Zeyliger added a comment -

        OK leave it.

        Show
        Philip Zeyliger added a comment - OK leave it.
        Hide
        Miki Tebeka added a comment -

        Nicer help

        Show
        Miki Tebeka added a comment - Nicer help
        Hide
        Philip Zeyliger added a comment -

        Unless anyone has objections, I'll commit this Sunday or Monday. Holler!

        Show
        Philip Zeyliger added a comment - Unless anyone has objections, I'll commit this Sunday or Monday. Holler!
        Hide
        Miki Tebeka added a comment -

        Philip - if you didn't commit yet. Can you add https://bitbucket.org/tebeka/avrocat/changeset/768916506786 ?

        Show
        Miki Tebeka added a comment - Philip - if you didn't commit yet. Can you add https://bitbucket.org/tebeka/avrocat/changeset/768916506786 ?
        Hide
        Philip Zeyliger added a comment -

        Miki--I haven't.

        Would you mind posting that as a patch? I don't have mercurial handy, plus if you post a patch it's quite explicit that you're agreeing to the apache license terms.

        Show
        Philip Zeyliger added a comment - Miki--I haven't. Would you mind posting that as a patch? I don't have mercurial handy, plus if you post a patch it's quite explicit that you're agreeing to the apache license terms.
        Hide
        Miki Tebeka added a comment -

        New patch with fix for encoding issue and minor test fix.

        Show
        Miki Tebeka added a comment - New patch with fix for encoding issue and minor test fix.
        Hide
        Philip Zeyliger added a comment -

        Committed revision 1137526.

        A small python suggestion for next time: since you imported "avro.schema", using "avro" as a variable name is suggested against, because it's a local that's redefining something that's in an outer scope (the module avro). pyflakes in my editor complained about it.

        Thank you for your contribution!

        Show
        Philip Zeyliger added a comment - Committed revision 1137526. A small python suggestion for next time: since you imported "avro.schema", using "avro" as a variable name is suggested against, because it's a local that's redefining something that's in an outer scope (the module avro). pyflakes in my editor complained about it. Thank you for your contribution!
        Hide
        Harsh J added a comment -

        This is a wonderful tool. Am late here, but thanks again Miki!

        Show
        Harsh J added a comment - This is a wonderful tool. Am late here, but thanks again Miki!

          People

          • Assignee:
            Miki Tebeka
            Reporter:
            Miki Tebeka
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development