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 org.apache.beam.sdk.transforms.SerializableFunction<org.apache.beam.sdk.values.Row,com.google.api.services.bigquery.model.TableRow> |
toTableRow()
Convert a Beam
Row to a BigQuery TableRow. |
static com.google.api.services.bigquery.model.TableRow |
toTableRow(org.apache.beam.sdk.values.Row row) |
static com.google.api.services.bigquery.model.TableSchema |
toTableSchema(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row> rows)
Convert a Beam
PCollection to a BigQuery TableSchema. |
static com.google.api.services.bigquery.model.TableSchema |
toTableSchema(org.apache.beam.sdk.schemas.Schema schema)
Convert a Beam
Schema to a BigQuery TableSchema. |
public static com.google.api.services.bigquery.model.TableSchema toTableSchema(org.apache.beam.sdk.schemas.Schema schema)
Schema to a BigQuery TableSchema.public static com.google.api.services.bigquery.model.TableSchema toTableSchema(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row> rows)
PCollection to a BigQuery TableSchema.public static org.apache.beam.sdk.transforms.SerializableFunction<org.apache.beam.sdk.values.Row,com.google.api.services.bigquery.model.TableRow> toTableRow()
Row to a BigQuery TableRow.public static com.google.api.services.bigquery.model.TableRow toTableRow(org.apache.beam.sdk.values.Row row)