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

idl2schemata: types with the same name in different namespaces => overwritten files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10.0, 1.9.1
    • None
    • tools
    • None

    Description

      For the following AVDL:

      @namespace("ns1")
      protocol Proto {
        record Foo {
          ns2.Foo foo;
        }  
      
        @namespace("ns2")
        record Foo {
          int x;
        }
      }
      
      

      the tool will generate just a single file named Foo.avsc with the schema of the last record Foo.

       

      Suggested solution:

      Add an option to the idl2schemata command named, for example, -fqnames that will make the tool generate files named using full qualified type names. For example, for the protocol shown above the files would be named:

      ns1.Foo.avsc
      ns2.Foo.avsc

       

      Impact:

      My company wanted to use Avro IDL as a specification format for the schemas (more readable, ability to import other files). We need to push the schemas to kafka Schema Registry. We could use idl2schemata  to generate schemas in JSON format but we risk pushing wrong schema whenever different teams working on schemas from different namespaces create a type with the same base name.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jrosiek Jarek Rosiek
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: