com.google.cloud.dataflow.sdk.io

## Class BigQueryIO.Read.Bound

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.PTransform<PInput,PCollection<TableRow>>
  - - com.google.cloud.dataflow.sdk.io.BigQueryIO.Read.Bound

All Implemented Interfaces:
  HasDisplayData, Serializable

Enclosing class:
  BigQueryIO.Read

    public static class BigQueryIO.Read.Bound
    extends PTransform<PInput,PCollection<TableRow>>

A `PTransform` that reads from a BigQuery table and returns a bounded `PCollection` of `TableRows`.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform

`name`

### Method Summary

All Methods Instance Methods Concrete Methods
`PCollection<TableRow>` `apply(PInput input)` Applies this `PTransform` on the given `InputT`, and returns its `Output`.
`BigQueryIO.Read.Bound` `from(String tableSpec)` Returns a copy of this transform that reads from the specified table.
`BigQueryIO.Read.Bound` `from(TableReference table)` Returns a copy of this transform that reads from the specified table.
`BigQueryIO.Read.Bound` `fromQuery(String query)` Returns a copy of this transform that reads the results of the specified query.
`protected Coder<TableRow>` `getDefaultOutputCoder()` Returns the default `Coder` to use for the output of this single-output `PTransform`.
`Boolean` `getFlattenResults()` Returns true/false if result flattening is enabled/disabled, or null if not applicable.
`String` `getQuery()` Returns the query to be read, or `null` if reading from a table instead.
`TableReference` `getTable()` Returns the table to read, or `null` if reading from a query instead.
`Boolean` `getUseLegacySql()` Returns true (false) if the query will (will not) use BigQuery's legacy SQL mode, or null if not applicable.
`boolean` `getValidate()` Returns true if table validation is enabled.
`BigQueryIO.Read.Bound` `named(String name)` Returns a copy of this transform using the name associated with this transformation.
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.
`BigQueryIO.Read.Bound` `usingStandardSql()` Enables BigQuery's Standard SQL dialect when reading from a query.
`void` `validate(PInput input)` Called before invoking apply (which may be intercepted by the runner) to verify this transform is fully specified and applicable to the specified input.
`BigQueryIO.Read.Bound` `withoutResultFlattening()` Disable flattening of query results.
`BigQueryIO.Read.Bound` `withoutValidation()` Disable table validation.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform

`getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString`

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

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

### Method Detail

#### named

    public BigQueryIO.Read.Bound named(String name)

Returns a copy of this transform using the name associated with this transformation.

Does not modify this object.

#### from

    public BigQueryIO.Read.Bound from(String tableSpec)

Returns a copy of this transform that reads from the specified table. Refer to `BigQueryIO.parseTableSpec(String)` for the specification format.

Does not modify this object.

#### from

    public BigQueryIO.Read.Bound from(TableReference table)

Returns a copy of this transform that reads from the specified table.

Does not modify this object.

#### fromQuery

    public BigQueryIO.Read.Bound fromQuery(String query)

Returns a copy of this transform that reads the results of the specified query.

Does not modify this object.

By default, the query results will be flattened -- see "flattenResults" in the Jobs documentation for more information. To disable flattening, use `withoutResultFlattening()`.

By default, the query will use BigQuery's legacy SQL dialect. To use the BigQuery Standard SQL dialect, use `usingStandardSql()`.

#### withoutValidation

    public BigQueryIO.Read.Bound withoutValidation()

Disable table validation.

#### withoutResultFlattening

    public BigQueryIO.Read.Bound withoutResultFlattening()

Disable flattening of query results.

Only valid when a query is used (`fromQuery(java.lang.String)`). Setting this option when reading from a table will cause an error during validation.

#### usingStandardSql

    public BigQueryIO.Read.Bound usingStandardSql()

Enables BigQuery's Standard SQL dialect when reading from a query.

Only valid when a query is used (`fromQuery(java.lang.String)`). Setting this option when reading from a table will cause an error during validation.

#### validate

    public void validate(PInput input)

Description copied from class: `PTransform`
Called before invoking apply (which may be intercepted by the runner) to verify this transform is fully specified and applicable to the specified input.

By default, does nothing.

Overrides:
  `validate` in class `PTransform<PInput,PCollection<TableRow>>`

#### apply

    public PCollection<TableRow> apply(PInput input)

Description copied from class: `PTransform`
Applies this `PTransform` on the given `InputT`, and returns its `Output`.

Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

The default implementation throws an exception. A derived class must either implement apply, or else each runner must supply a custom implementation via `PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<InputT, OutputT>, InputT)`.

Overrides:
  `apply` in class `PTransform<PInput,PCollection<TableRow>>`

#### getDefaultOutputCoder

    protected Coder<TableRow> getDefaultOutputCoder()

Description copied from class: `PTransform`
Returns the default `Coder` to use for the output of this single-output `PTransform`.

By default, always throws

Overrides:
  `getDefaultOutputCoder` in class `PTransform<PInput,PCollection<TableRow>>`

#### populateDisplayData

    public void populateDisplayData(DisplayData.Builder builder)

Description copied from class: `PTransform`
Register display data for the given transform or component.

`populateDisplayData(DisplayData.Builder)` is invoked by Pipeline runners to collect display data via `DisplayData.from(HasDisplayData)`. Implementations may call `super.populateDisplayData(builder)` in order to register display data in the current namespace, but should otherwise use `subcomponent.populateDisplayData(builder)` to use the namespace of the subcomponent.

By default, does not register any display data. Implementors may override this method to provide their own display data.

Specified by:
  `populateDisplayData` in interface `HasDisplayData`
Overrides:
  `populateDisplayData` in class `PTransform<PInput,PCollection<TableRow>>`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`

#### getTable

    public TableReference getTable()

Returns the table to read, or `null` if reading from a query instead.

#### getQuery

    public String getQuery()

Returns the query to be read, or `null` if reading from a table instead.

#### getValidate

    public boolean getValidate()

Returns true if table validation is enabled.

#### getFlattenResults

    public Boolean getFlattenResults()

Returns true/false if result flattening is enabled/disabled, or null if not applicable.

#### getUseLegacySql

    @Nullable
    public Boolean getUseLegacySql()

Returns true (false) if the query will (will not) use BigQuery's legacy SQL mode, or null if not applicable.