Avro: Code Generation
This lesson demonstrates how to work with Avro while using generated code.
We'll cover the following...
We'll cover the following...
Avro with Code Generation
The previous lesson demonstrated a program that used GenericRecord interface to serialize and deserialize data. This approach requires us to cast the individual fields of the record to the right data-type. For instance, if we want to print the model year of each car record, the program would look like as this:
In line 25, we explicitly cast the object returned from the get() method to an integer. The code will not compile otherwise. ...