public static class BigQueryIO.Read
extends java.lang.Object
PCollection<TableRow> containing each of the rows of the table.
Each TableRow record contains values indexed by column name. Here is a sample processing function which processes a "line" column from rows:
static class ExtractWordsFn extends DoFn<TableRow, String> {
@Override
public void processElement(ProcessContext c) {
// Get the "line" field of the TableRow object, split it into words, and emit them.
TableRow row = c.element();
String[] words = row.get("line").toString().split("[^a-zA-Z']+");
for (String word : words) {
if (!word.isEmpty()) {
c.output(word);
}
}
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
BigQueryIO.Read.Bound
A PTransform that reads from a BigQuery table and returns a bounded
PCollection<TableRow>. |
| Constructor and Description |
|---|
BigQueryIO.Read() |
| Modifier and Type | Method and Description |
|---|---|
static BigQueryIO.Read.Bound |
from(java.lang.String tableSpec)
Reads a BigQuery table specified as
"[project_id]:[dataset_id].[table_id]" or "[dataset_id].[table_id]" for
tables within the current project.
|
static BigQueryIO.Read.Bound |
from(TableReference table)
Reads a BigQuery table specified as a TableReference object.
|
static BigQueryIO.Read.Bound |
named(java.lang.String name) |
static BigQueryIO.Read.Bound |
withoutValidation()
Disables BigQuery table validation which is enabled by default.
|
public static BigQueryIO.Read.Bound named(java.lang.String name)
public static BigQueryIO.Read.Bound from(java.lang.String tableSpec)
public static BigQueryIO.Read.Bound from(TableReference table)
public static BigQueryIO.Read.Bound withoutValidation()