Avro
  1. Avro
  2. AVRO-1272

Ruby implementation does not handle namespaces correctly

    Details

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

      Description

      The Ruby implementation of schema and protocol parsing violates the following statement in the Avro spec, with respect to name resolution: "the namespace is taken from the most tightly enclosing schema or protocol". Currently, any nested named types without explicit namespace property are taken as being in the default namespace, not in the enclosing schema/protocol's namespace.

      1. AVRO-1272.patch
        19 kB
        Martin Kleppmann

        Activity

        Hide
        Martin Kleppmann added a comment -

        Attached a suite of test cases that reproduces the problem, and a patch that fixes it. I have had to add method parameters in various places, but I have made them optional, so this is a backwards-compatible API change.

        Show
        Martin Kleppmann added a comment - Attached a suite of test cases that reproduces the problem, and a patch that fixes it. I have had to add method parameters in various places, but I have made them optional, so this is a backwards-compatible API change.
        Hide
        Martin Kleppmann added a comment -

        Hi Doug, any chance you could take a look at this patch? Thanks!

        Show
        Martin Kleppmann added a comment - Hi Doug, any chance you could take a look at this patch? Thanks!
        Hide
        Doug Cutting added a comment -

        I committed this. Thanks, Martin!

        Show
        Doug Cutting added a comment - I committed this. Thanks, Martin!
        Hide
        Hudson added a comment -

        Integrated in AvroJava #359 (See https://builds.apache.org/job/AvroJava/359/)
        AVRO-1272. Ruby: Improve schema namespace handling. Contributed by Martin Kleppmann. (Revision 1458349)

        Result = SUCCESS
        cutting :
        Files :

        • /avro/trunk/CHANGES.txt
        • /avro/trunk/lang/ruby/lib/avro/protocol.rb
        • /avro/trunk/lang/ruby/lib/avro/schema.rb
        • /avro/trunk/lang/ruby/test/test_protocol.rb
        • /avro/trunk/lang/ruby/test/test_schema.rb
        Show
        Hudson added a comment - Integrated in AvroJava #359 (See https://builds.apache.org/job/AvroJava/359/ ) AVRO-1272 . Ruby: Improve schema namespace handling. Contributed by Martin Kleppmann. (Revision 1458349) Result = SUCCESS cutting : Files : /avro/trunk/CHANGES.txt /avro/trunk/lang/ruby/lib/avro/protocol.rb /avro/trunk/lang/ruby/lib/avro/schema.rb /avro/trunk/lang/ruby/test/test_protocol.rb /avro/trunk/lang/ruby/test/test_schema.rb

          People

          • Assignee:
            Martin Kleppmann
            Reporter:
            Martin Kleppmann
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development