You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Mark Farnan (Jira)" <ji...@apache.org> on 2022/12/02 18:07:00 UTC

[jira] [Created] (AVRO-3683) Rust Writer, Reader can't use Schemas with dependencies in other Schemas. i.e. The output of Schema::parse_list

Mark Farnan created AVRO-3683:
---------------------------------

             Summary: Rust  Writer, Reader can't use Schemas with dependencies in other Schemas.   i.e. The output of Schema::parse_list 
                 Key: AVRO-3683
                 URL: https://issues.apache.org/jira/browse/AVRO-3683
             Project: Apache Avro
          Issue Type: Bug
          Components: rust
    Affects Versions: 1.11.1
            Reporter: Mark Farnan


Avro permits Schema definitions to reference Types defined in other Schema files. 

Currently these can be parsed with Schema:parse_list, but the output of this can't be used in Writer, Reader,  (or to_avro_datum,  from_avro_datum)
 * These functions only take a single 'schema' and can't resolve the References
 * Schema:parse_list puts in 'refs' for the external dependencies, but doesn't seem to populate the UnionSchema's, so they can be resolved.

 

+Example of dependant schemas:+
letschema_TypeA=r#"
{
"type": "record",
"namespace": "base.name.space",
"name": "MultiSchemaTestTypeA",
"fields":
[
{ "name": "b", "type": ["null", "some.name.space.MultiSchemaTestTypeB"] },
{
"name": "c",
"type": \{ "type": "map", "values": "some.name.space.MultiSchemaTestTypeB" }, "default": {}
}
]
}
"#;

letschema_TypeB=r#"
{
"type": "record",
"namespace": "some.name.space",
"name": "MultiSchemaTestTypeB",
"fields":
[
{ "name": "d", "type": "string" },
{ "name": "e", "type": "int" }
]
}
"#;
 

Note: In process of creating a PR with a failing test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)