You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Jarek Rosiek (Jira)" <ji...@apache.org> on 2020/02/07 08:50:00 UTC
[jira] [Updated] (AVRO-2728) idl2schemata: types with the same name
in different namespaces => overwritten files
[ https://issues.apache.org/jira/browse/AVRO-2728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jarek Rosiek updated AVRO-2728:
-------------------------------
Summary: idl2schemata: types with the same name in different namespaces => overwritten files (was: idl2schemata: same types in different namespaces => overwritten files)
> idl2schemata: types with the same name in different namespaces => overwritten files
> -----------------------------------------------------------------------------------
>
> Key: AVRO-2728
> URL: https://issues.apache.org/jira/browse/AVRO-2728
> Project: Apache Avro
> Issue Type: Bug
> Components: tools
> Affects Versions: 1.10.0, 1.9.1
> Reporter: Jarek Rosiek
> Priority: Major
>
> For the following AVDL:
> {code:java}
> @namespace("ns1")
> protocol Proto {
> record Foo {
> ns2.Foo foo;
> }
> @namespace("ns2")
> record Foo {
> int x;
> }
> }
> {code}
> the tool will generate just a single file named {{Foo.avsc}} with the schema of the last record Foo.
>
> Suggested solution:
> Add an option to the {{idl2schemata}} command named, for example, {{-fqnames}} that will make the tool generate files named using full qualified type names. For example, for the protocol shown above the files would be named:
> {code:java}
> ns1.Foo.avsc
> ns2.Foo.avsc{code}
>
> Impact:
> My company wanted to use Avro IDL as a specification format for the schemas (more readable, ability to import other files). We need to push the schemas to kafka Schema Registry. We could use {{idl2schemata}} to generate schemas in JSON format but we risk pushing wrong schema whenever different teams working on schemas from different namespaces create a type with the same base name.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)