[ 
https://issues.apache.org/jira/browse/AVRO-3900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785593#comment-17785593
 ] 

Jon Slusher commented on AVRO-3900:
-----------------------------------

I submitted a discussion topic to the email group. The way I see it, there are 
two issues. One is that the Avro spec doesn't allow hyphens. I think ultimately 
it should be made to allow them since they're so common.

If that's easier said than done, then I think at the least if the registry is 
going to allow hyphens to make their way into these schemas like they have in 
our case, then any deserializer library should also have the same 
permissiveness. The SDK for Python seems to allow them and I believe the Java 
Avro SDK might also permit them. If that's the case, then I think the SDK for 
Rust should also leave checking the spec to Avro and the Schema Registry itself.

> Permissiveness in schema namespaces for rust SDK?
> -------------------------------------------------
>
>                 Key: AVRO-3900
>                 URL: https://issues.apache.org/jira/browse/AVRO-3900
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: rust
>    Affects Versions: 1.11.3
>            Reporter: Jon Slusher
>            Priority: Major
>
> We have an Avro schema registry that has schema with hyphens in some of the 
> namespaces. These schema were created by our Debezium connectors. We have 
> Python consumers that are able to use them without an issue, but we're trying 
> to write a consumer in Rust and it appears that the Avro SDK for rust doesn't 
> support this permissiveness.
>  
> Here's an example of one of the schema created by our Debezium connectors: 
>  
> {code:java}
> {
>   "type": "record",
>   "name": "Envelope",
>   "namespace": "debezium.example-connector-20231005.database.my_table",
>   "fields": [
>     {
>       "name": "before",
>       "type": [
>         "null",
>         {
>           "type": "record",
>           "name": "Value",
>           "fields": [
>             {
>               "name": "id",
>               "type": "int"
>             },
>             {
>               "name": "uid",
>               "type": {
>                 "type": "long",
>                 "connect.default": 0
>               },
>               "default": 0
>             },
> ...
> {code}
>  
> If that schema is allowed in our Avro Schema Registry I would think that it 
> should be allowed by any consumer trying to use it. 
>  
> I opened an [issue in the rust schema converter crate's 
> repository|[https://github.com/gklijs/schema_registry_converter/issues/100]], 
> and it appears that the problem is in the Avro SDK. 



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

Reply via email to