You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Bheema (JIRA)" <ji...@apache.org> on 2019/04/08 14:47:00 UTC

[jira] [Created] (AVRO-2371) How can import one "avrofile" in another "avrofile" like java import

Bheema created AVRO-2371:
----------------------------

             Summary: How can import one "avrofile" in another "avrofile" like java import
                 Key: AVRO-2371
                 URL: https://issues.apache.org/jira/browse/AVRO-2371
             Project: Apache Avro
          Issue Type: Improvement
            Reporter: Bheema


{
 "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",
 {color:#FF0000}*"imports": ["user.avsc"],*{color}
 "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)

 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)