You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kousuke Saruta (Jira)" <ji...@apache.org> on 2023/07/23 13:27:00 UTC
[jira] [Created] (AVRO-3812) Handle null namespace properly
Kousuke Saruta created AVRO-3812:
------------------------------------
Summary: Handle null namespace properly
Key: AVRO-3812
URL: https://issues.apache.org/jira/browse/AVRO-3812
Project: Apache Avro
Issue Type: Improvement
Components: rust
Affects Versions: 1.12.0
Reporter: Kousuke Saruta
Considering the following schema, which contains namespaces of "".
{code}
{
"namespace": "",
"type": "record",
"name": "my_schema",
"fields": [
{
"name": "a",
"type": {
"type": "enum",
"name": "my_enum",
"namespace": "",
"symbols": ["a", "b"]
}
}, {
"name": "b",
"type": {
"type": "fixed",
"name": "my_fixed",
"namespace": "",
"size": 10
}
}
]
}
{code}
If we try to canonicalize this schema with the following code
{code}
let schema = Schema::parse_str(schema_str).unwrap().canonical_form();
println!("{schema}");
{code}
We get the following result.
{code}
{"name":".my_schema","type":"record","fields":[{"name":"a","type":{"name":".my_enum","type":"enum","symbols":["a","b"]}},{"name":"b","type":{"name":".my_fixed","type":"fixed","size":10}}]}
{code}
But .my_schema, .my_enum and .my_fixed should not starts with a dot.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)