Skip to content

Commit

Permalink
feat: create rows type
Browse files Browse the repository at this point in the history
  • Loading branch information
gintarasm committed Jan 24, 2024
1 parent cecba75 commit de41769
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/vinted/flink/bigquery/typeutils/RowsType.java
Original file line number Diff line number Diff line change
@@ -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 <A> TypeInformation<Rows<A>> of(TypeInformation<A> typeInfo) {
return Types.POJO((Class<Rows<A>>)(Class<?>)Rows.class, Map.of(
"data", Types.LIST(typeInfo),
"offset", Types.LONG,
"stream", Types.STRING,
"table", TypeInformation.of(TableId.class)
));
}
}

0 comments on commit de41769

Please sign in to comment.