cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

add custom metadata to avro file with pyspark

zak
New Contributor II

Hello,

i need to add a custom metadata into a avro file. The avro file containt data.

we have tried to use "option" within the write function but it's not taken without generated any error.

df.write.format("avro").option("avro.codec", "snappy").option("header", "metadata_key:metadata_value").mode("overwrite").save("/tmp/avro_with_metadata")

I'm seeking a solution to add a custom metadata into a data avro file.

Thanks,

Zakaria

1 REPLY 1

zak
New Contributor II

thank you a lot for your answer, it's very helpful.

I have a additionnal question please, is it possible to add a avro binnary metada inside the json avro_schema?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group