diff --git a/src/main/java/com/vinted/flink/bigquery/typeutils/RowsType.java b/src/main/java/com/vinted/flink/bigquery/typeutils/RowsType.java new file mode 100644 index 0000000..4d51a1f --- /dev/null +++ b/src/main/java/com/vinted/flink/bigquery/typeutils/RowsType.java @@ -0,0 +1,19 @@ +package com.vinted.flink.bigquery.typeutils; + +import com.google.cloud.bigquery.TableId; +import com.vinted.flink.bigquery.model.Rows; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.common.typeinfo.Types; + +import java.util.Map; + +public class RowsType { + public static TypeInformation> of(TypeInformation typeInfo) { + return Types.POJO((Class>)(Class)Rows.class, Map.of( + "data", Types.LIST(typeInfo), + "offset", Types.LONG, + "stream", Types.STRING, + "table", TypeInformation.of(TableId.class) + )); + } +}