public class WriteToBigQuery<InputT>
extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<InputT>,org.apache.beam.sdk.values.PDone>
| Modifier and Type | Class and Description |
|---|---|
protected class |
WriteToBigQuery.BuildRowFn
Convert each key/score pair into a BigQuery TableRow as specified by fieldFn.
|
static interface |
WriteToBigQuery.FieldFn<InputT>
A
Serializable function from a DoFn.ProcessContext and BoundedWindow to
the value for that field. |
static class |
WriteToBigQuery.FieldInfo<InputT>
Define a class to hold information about output table field definitions.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
datasetId |
protected java.util.Map<java.lang.String,WriteToBigQuery.FieldInfo<InputT>> |
fieldInfo |
protected java.lang.String |
projectId |
protected java.lang.String |
tableName |
| Constructor and Description |
|---|
WriteToBigQuery() |
WriteToBigQuery(java.lang.String projectId,
java.lang.String datasetId,
java.lang.String tableName,
java.util.Map<java.lang.String,WriteToBigQuery.FieldInfo<InputT>> fieldInfo) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.values.PDone |
expand(org.apache.beam.sdk.values.PCollection<InputT> teamAndScore) |
protected com.google.api.services.bigquery.model.TableSchema |
getSchema()
Build the output table schema.
|
protected java.lang.String projectId
protected java.lang.String datasetId
protected java.lang.String tableName
protected java.util.Map<java.lang.String,WriteToBigQuery.FieldInfo<InputT>> fieldInfo
public WriteToBigQuery()
public WriteToBigQuery(java.lang.String projectId,
java.lang.String datasetId,
java.lang.String tableName,
java.util.Map<java.lang.String,WriteToBigQuery.FieldInfo<InputT>> fieldInfo)