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

Usage of Parser is Wrong in Getting Started Guide

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.4, 1.7.5, 1.7.6
    • Fix Version/s: 1.7.7
    • Component/s: None
    • Labels:
      None

      Description

      In the Getting Started Guide for java, in the "Serializing and deserializing without code generation" section, for versions 1.7.3 and later, I still see this:

      Schema schema = new Parser().parse(new File("user.avsc"));

      This is COMPLETELY confusing to people, I am assuming now that you have imported org.apache.avro.Schema.Parser, but that is not clear to the users.

      There is also a class in avro called org.apache.avro.io.parsing.Parser, most users would look at your "Parser" in the example and think you are talking about "org.apache.avro.io.parsing.Parser", when you are actually talking about "org.apache.avro.Schema.Parser"

      I just wasted the last hour of my life trying to figure this out. Please fix your documentation. Either tell people exactly what parser you are importing, or explicitly state it like this:

      Schema schema = new Schema.Parser().parse(in);

        Attachments

          Activity

            People

            • Assignee:
              cutting Doug Cutting
              Reporter:
              msknapp84 Michael Knapp
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: