Avro
  1. Avro
  2. AVRO-1445

avro from protobuf write fails on enum with default

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.7
    • Component/s: None
    • Labels:
      None

      Description

      If the protobuf you're attempting to write out as avro has a enum field with a default, the following error occurs:

      Caused by: java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('c' (code 99)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
      at [Source: java.io.StringReader@118a8bef; line: 1, column: 2]
      at org.apache.avro.protobuf.ProtobufData.getDefault(ProtobufData.java:317)
      at org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:208)
      at org.apache.avro.protobuf.ProtobufData.getNonRepeatedSchema(ProtobufData.java:283)
      at org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:255)
      at org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:208)
      at org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:176)
      ... 36 more
      java.lang.RuntimeException: java.lang.RuntimeException: org.codehaus.jackson.JsonParseException: Unexpected character ('c' (code 99)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
      at [Source: java.io.StringReader@7d50c032; line: 1, column: 2]
      at org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:178)

      1. AVRO-1445.patch
        6 kB
        Doug Cutting

        Activity

        George Baxter created issue -
        Hide
        Doug Cutting added a comment -

        Here's a patch that fixes this.

        Show
        Doug Cutting added a comment - Here's a patch that fixes this.
        Doug Cutting made changes -
        Field Original Value New Value
        Attachment AVRO-1445.patch [ 12624942 ]
        Hide
        Doug Cutting added a comment -

        I'll commit this soon unless there are objections.

        Show
        Doug Cutting added a comment - I'll commit this soon unless there are objections.
        Doug Cutting made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Assignee Doug Cutting [ cutting ]
        Fix Version/s 1.7.7 [ 12326041 ]
        Hide
        ASF subversion and git services added a comment -

        Commit 1561875 from Doug Cutting in branch 'avro/trunk'
        [ https://svn.apache.org/r1561875 ]

        AVRO-1445. Java: Fix protobuf support to correctly handle enums with default values.

        Show
        ASF subversion and git services added a comment - Commit 1561875 from Doug Cutting in branch 'avro/trunk' [ https://svn.apache.org/r1561875 ] AVRO-1445 . Java: Fix protobuf support to correctly handle enums with default values.
        Hide
        Doug Cutting added a comment -

        I committed this.

        Show
        Doug Cutting added a comment - I committed this.
        Doug Cutting made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in AvroJava #429 (See https://builds.apache.org/job/AvroJava/429/)
        AVRO-1445. Java: Fix protobuf support to correctly handle enums with default values. (cutting: rev 1561875)

        • /avro/trunk/CHANGES.txt
        • /avro/trunk/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java
        • /avro/trunk/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/Test.java
        • /avro/trunk/lang/java/protobuf/src/test/protobuf/test.proto
        Show
        Hudson added a comment - SUCCESS: Integrated in AvroJava #429 (See https://builds.apache.org/job/AvroJava/429/ ) AVRO-1445 . Java: Fix protobuf support to correctly handle enums with default values. (cutting: rev 1561875) /avro/trunk/CHANGES.txt /avro/trunk/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java /avro/trunk/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/Test.java /avro/trunk/lang/java/protobuf/src/test/protobuf/test.proto
        Doug Cutting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2h 19m 1 Doug Cutting 23/Jan/14 23:06
        Patch Available Patch Available Resolved Resolved
        3d 23h 2m 1 Doug Cutting 27/Jan/14 22:09
        Resolved Resolved Closed Closed
        177d 22h 6m 1 Doug Cutting 24/Jul/14 21:16

          People

          • Assignee:
            Doug Cutting
            Reporter:
            George Baxter
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development