com.google.cloud.dataflow.sdk.io

## Class BigQueryIO.Read

- java.lang.Object
- - com.google.cloud.dataflow.sdk.io.BigQueryIO.Read

Enclosing class:
  BigQueryIO

    public static class BigQueryIO.Read
    extends Object

A `PTransform` that reads from a BigQuery table and returns a `PCollection` of `TableRows` containing each of the rows of the table.

Each `TableRow` contains values indexed by column name. Here is a sample processing function that processes a "line" column from rows:

     static class ExtractWordsFn extends DoFn<TableRow, String> {
       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);
           }
         }
       }
     }

### Nested Class Summary

Nested Classes
`static class` `BigQueryIO.Read.Bound` A `PTransform` that reads from a BigQuery table and returns a bounded `PCollection` of `TableRows`.

### Method Summary

All Methods Static Methods Concrete Methods
`static BigQueryIO.Read.Bound` `from(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` `fromQuery(String query)` Reads results received after executing the given query.
`static BigQueryIO.Read.Bound` `named(String name)` Returns a `BigQueryIO.Read.Bound` with the given name.
`static BigQueryIO.Read.Bound` `withoutValidation()` Disables BigQuery table validation, which is enabled by default.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### named

    public static BigQueryIO.Read.Bound named(String name)

Returns a `BigQueryIO.Read.Bound` with the given name. The BigQuery table or query to be read from has not yet been configured.

#### from

    public static BigQueryIO.Read.Bound from(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.

#### fromQuery

    public static BigQueryIO.Read.Bound fromQuery(String query)

Reads results received after executing the given query.

#### from

    public static BigQueryIO.Read.Bound from(TableReference table)

Reads a BigQuery table specified as a `TableReference` object.

#### withoutValidation

    public static BigQueryIO.Read.Bound withoutValidation()

Disables BigQuery table validation, which is enabled by default.