Class AvroGenericRecordToRowDataMapper

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.MapFunction<org.apache.avro.generic.GenericRecord,​org.apache.flink.table.data.RowData>

    public class AvroGenericRecordToRowDataMapper
    extends java.lang.Object
    implements org.apache.flink.api.common.functions.MapFunction<org.apache.avro.generic.GenericRecord,​org.apache.flink.table.data.RowData>
    This util class converts Avro GenericRecord to Flink RowData.

    Internally it uses Flink AvroToRowDataConverters. Because of the precision difference between how Iceberg schema (micro) and Flink AvroToRowDataConverters (milli) deal with time type, we can't directly use the Avro Schema converted from Iceberg schema via AvroSchemaUtil.convert(org.apache.iceberg.Schema, String).
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AvroGenericRecordToRowDataMapper forAvroSchema​(org.apache.avro.Schema avroSchema)
      Create a mapper based on Avro schema.
      org.apache.flink.table.data.RowData map​(org.apache.avro.generic.GenericRecord genericRecord)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • map

        public org.apache.flink.table.data.RowData map​(org.apache.avro.generic.GenericRecord genericRecord)
                                                throws java.lang.Exception
        Specified by:
        map in interface org.apache.flink.api.common.functions.MapFunction<org.apache.avro.generic.GenericRecord,​org.apache.flink.table.data.RowData>
        Throws:
        java.lang.Exception