Skip to main content
johndcal
Gold ⭐️
May 15, 2020 7:51 PM UTC
Solved

AVRO Schema Registry Namespace

Is the namespace field in an AVRO schema required?  Does the namespace first have to be created if you provide it in the schema?  Not sure how this works.

 

Thanks,

 

johndcal

stevenmatison
Platinum ⭐️⭐️
May 16, 2020 12:33 PM UTC

@johndcal A namespace is not required within the avro schema source in Schema Registry.   In the context of avro spec. 

 

In order to create an avro schema in the Schema Registry, you have to send the first call to create the schema entity.  The next call is then to add the actual avro schema to the existing entity.  This is just the behavior of the Schema Registry.   You can find some lessons I created in how to use the registry:

 

https://community.cloudera.com/t5/Community-Articles/Using-the-Schema-Registry-API/ta-p/286194

 

I also have an article showing how to fully automate the creation of Avro Schemas from CSV file (column name and data type) using the Schema Registry, Hive, and NiFI:

 

https://community.cloudera.com/t5/Community-Articles/How-to-automate-creation-of-Avro-and-Hive-Schemas-using-NiFi/ta-p/293183

 

 

If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  

 

Thanks,


Steven @ DFHZ

1 reply

stevenmatison
Platinum ⭐️⭐️
May 16, 2020 12:33 PM UTC

@johndcal A namespace is not required within the avro schema source in Schema Registry.   In the context of avro spec. 

 

In order to create an avro schema in the Schema Registry, you have to send the first call to create the schema entity.  The next call is then to add the actual avro schema to the existing entity.  This is just the behavior of the Schema Registry.   You can find some lessons I created in how to use the registry:

 

https://community.cloudera.com/t5/Community-Articles/Using-the-Schema-Registry-API/ta-p/286194

 

I also have an article showing how to fully automate the creation of Avro Schemas from CSV file (column name and data type) using the Schema Registry, Hive, and NiFI:

 

https://community.cloudera.com/t5/Community-Articles/How-to-automate-creation-of-Avro-and-Hive-Schemas-using-NiFi/ta-p/293183

 

 

If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  

 

Thanks,


Steven @ DFHZ

Translate