public class BigQueryUtils
extends java.lang.Object
Example: Writing to BigQuery
PCollection<Row> rows = ...;
rows.apply(BigQueryIO.<Row>write()
.withSchema(BigQueryUtils.toTableSchema(rows))
.withFormatFunction(BigQueryUtils.toTableRow())
.to("my-project:my_dataset.my_table"));
Constructor and Description |
---|
BigQueryUtils() |
Modifier and Type | Method and Description |
---|---|
static SerializableFunction<Row,TableRow> |
toTableRow()
|
static TableRow |
toTableRow(Row row) |
static TableSchema |
toTableSchema(PCollection<Row> rows)
Convert a Beam
PCollection to a BigQuery TableSchema . |
static TableSchema |
toTableSchema(Schema schema)
Convert a Beam
Schema to a BigQuery TableSchema . |
public static TableSchema toTableSchema(Schema schema)
Schema
to a BigQuery TableSchema
.public static TableSchema toTableSchema(PCollection<Row> rows)
PCollection
to a BigQuery TableSchema
.public static SerializableFunction<Row,TableRow> toTableRow()