Avro
  1. Avro
  2. AVRO-246

Java schema parser should take schema from InputStream in addition to file

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: java
    • Labels:
      None

      Description

      Accepting the schema from an InputStream (in addition to the current File) enables many use-cases like taking schema from a resource in a jar file.

      1. AVRO-246.patch
        0.9 kB
        Thiruvalluvan M. G.
      2. AVRO-246.patch
        0.9 kB
        Thiruvalluvan M. G.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        5d 16h 37m 1 Thiruvalluvan M. G. 07/Dec/09 06:04
        Patch Available Patch Available Resolved Resolved
        2d 1h 39m 1 Thiruvalluvan M. G. 09/Dec/09 07:43
        Resolved Resolved Closed Closed
        82d 9h 25m 1 Doug Cutting 01/Mar/10 17:09
        Doug Cutting made changes -
        Component/s java [ 12312780 ]
        Doug Cutting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Doug Cutting made changes -
        Fix Version/s 1.3.0 [ 12314318 ]
        Thiruvalluvan M. G. made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Thiruvalluvan M. G. added a comment -

        Committed revision 888720 after adding comments and a test.

        Show
        Thiruvalluvan M. G. added a comment - Committed revision 888720 after adding comments and a test.
        Hide
        Doug Cutting added a comment -

        +1 This looks good. Can you also please add a simple javadoc comment, stating something like, "Construct a Schema from JSON text." The parse(File) method also needs similar javadoc.

        Show
        Doug Cutting added a comment - +1 This looks good. Can you also please add a simple javadoc comment, stating something like, "Construct a Schema from JSON text." The parse(File) method also needs similar javadoc.
        Thiruvalluvan M. G. made changes -
        Attachment AVRO-246.patch [ 12427337 ]
        Hide
        Thiruvalluvan M. G. added a comment -

        Good point Doug. Restored parse(File) to the original.

        Show
        Thiruvalluvan M. G. added a comment - Good point Doug. Restored parse(File) to the original.
        Hide
        Doug Cutting added a comment -

        The advantage of passing the File directly to Jackson is that Jackson can then generate error messages that include the file name and line number.

        Show
        Doug Cutting added a comment - The advantage of passing the File directly to Jackson is that Jackson can then generate error messages that include the file name and line number.
        Thiruvalluvan M. G. made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Thiruvalluvan M. G. made changes -
        Field Original Value New Value
        Attachment AVRO-246.patch [ 12427141 ]
        Hide
        Thiruvalluvan M. G. added a comment -

        This patch addresses the problem. Though I could have made Jackson accept java.io.File directly in File version of parse, I decided to delegate to to InputStream version so that there is no duplication of try/catch.

        Show
        Thiruvalluvan M. G. added a comment - This patch addresses the problem. Though I could have made Jackson accept java.io.File directly in File version of parse, I decided to delegate to to InputStream version so that there is no duplication of try/catch.
        Thiruvalluvan M. G. created issue -

          People

          • Assignee:
            Thiruvalluvan M. G.
            Reporter:
            Thiruvalluvan M. G.
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development