A
PTransform that writes a
PCollection to a BigQuery table. A formatting
function must be provided to convert each input element into a
TableRow using
Write#withFormatFunction(SerializableFunction).
In BigQuery, each table has an encosing dataset. The dataset being written must already
exist.
By default, tables will be created if they do not exist, which corresponds to a
Write.CreateDisposition#CREATE_IF_NEEDED disposition that matches the default of BigQuery's
Jobs API. A schema must be provided (via
Write#withSchema(TableSchema)), or else the
transform may fail at runtime with an
IllegalArgumentException.
By default, writes require an empty table, which corresponds to a
Write.WriteDisposition#WRITE_EMPTY disposition that matches the default of BigQuery's Jobs
API.
Here is a sample transform that produces TableRow values containing "word" and "count"
columns:
static class FormatCountsFn extends DoFn, TableRow> }
}