Package org.apache.iceberg.flink.sink
Class AvroGenericRecordToRowDataMapper
- java.lang.Object
-
- org.apache.iceberg.flink.sink.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 FlinkAvroToRowDataConverters. Because of the precision difference between how Iceberg schema (micro) and FlinkAvroToRowDataConverters(milli) deal with time type, we can't directly use the Avro Schema converted from Iceberg schema viaAvroSchemaUtil.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 AvroGenericRecordToRowDataMapperforAvroSchema(org.apache.avro.Schema avroSchema)Create a mapper based on Avro schema.org.apache.flink.table.data.RowDatamap(org.apache.avro.generic.GenericRecord genericRecord)
-
-
-
Method Detail
-
map
public org.apache.flink.table.data.RowData map(org.apache.avro.generic.GenericRecord genericRecord) throws java.lang.Exception- Specified by:
mapin interfaceorg.apache.flink.api.common.functions.MapFunction<org.apache.avro.generic.GenericRecord,org.apache.flink.table.data.RowData>- Throws:
java.lang.Exception
-
forAvroSchema
public static AvroGenericRecordToRowDataMapper forAvroSchema(org.apache.avro.Schema avroSchema)
Create a mapper based on Avro schema.
-
-