For Flink Iceberg sink, we used GenericRecord/Record as the intermediate format between input and writing to DataFile.
But this conversion is not needed when the input format is Avro IndexedRecord, and we are also writing to a DataFile with Avro format.
See this comment.
FileWriter#write() also needs to be type parameterized, see this comment.