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

How can import one "avrofile" in another "avrofile" like java import

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      { "type": "record", "name": "User", "namespace": "example.avro", "fields": [ \{"name": "name", "type": "string"}

      ,
      {"name": "favorite_number", "type": ["int", "null"]},
      {"name": "favorite_color", "type": ["string", "null"]}
      ]
      }

       

       

      {"namespace": "example.avro",
      "type": "record",
      "imports": ["user.avsc"],
      "name": "Department",
      "fields": [
      {"name": "name", "type": "string"},
      {"name": "favorite_number", "type": ["int", "null"]},
      {"name": "favorite_color", "type": ["string", "null"]},
      {"name": "user","type": ["User"]}
      ]
      }

       

      Input files to compile:
      avro\linking\Department.avsc
      Exception in thread "main" org.apache.avro.SchemaParseException: Undefined name: "User"
      at org.apache.avro.Schema.parse(Schema.java:1228)
      at org.apache.avro.Schema.parse(Schema.java:1340)
      at org.apache.avro.Schema.parse(Schema.java:1269)
      at org.apache.avro.Schema$Parser.parse(Schema.java:1032)
      at org.apache.avro.Schema$Parser.parse(Schema.java:997)
      at org.apache.avro.tool.SpecificCompilerTool.run(SpecificCompilerTool.java:92)
      at org.apache.avro.tool.Main.run(Main.java:87)
      at org.apache.avro.tool.Main.main(Main.java:76)

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            bheema Bheema
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: