You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2023/07/26 21:52:00 UTC
[jira] [Resolved] (AVRO-3812) Handle null namespace properly for canonicalized schema representation
[ https://issues.apache.org/jira/browse/AVRO-3812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Tzvetanov Grigorov resolved AVRO-3812.
---------------------------------------------
Fix Version/s: 1.12.0
1.11.3
Assignee: Martin Tzvetanov Grigorov
Resolution: Fixed
> Handle null namespace properly for canonicalized schema representation
> ----------------------------------------------------------------------
>
> 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
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.12.0, 1.11.3
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> 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)