How to generate avro ocf format(with schema) data/file using scala?

454 Views Asked by At

I am new bee to Scala.

I have a requirement where my data (in case class) needs to be written to S3 bucket in avro OCF(schema included) format. I could see ways to generate/serialise avro non-ocf(schemaless) format data in scala but could not find the way to generate OCF format.

This link example shows how to generate non-OCF format, but I am looking for OCF format generation https://dzone.com/articles/kafka-avro-scala-example

Any help/suggestion would be appreciated.

1

There are 1 best solutions below

0
Matthias Berndt On BEST ANSWER

You need to use the com.sksamuel.avro4s.AvroDataOutputStream class.