com.google.cloud.dataflow.sdk.io

## Class BigQueryIO.Write.Bound

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

All Implemented Interfaces:
  HasDisplayData, Serializable

Enclosing class:
  BigQueryIO.Write

    public static class BigQueryIO.Write.Bound
    extends PTransform<PCollection<TableRow>,PDone>

A `PTransform` that can write either a bounded or unbounded `PCollection` of `TableRows` to a BigQuery table.

See Also:
  Serialized Form

### Field Summary

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

`name`

### Constructor Summary

Constructors
Constructor and Description
`Bound()` Deprecated. Should be private. Instead, use one of the factory methods in `BigQueryIO.Write`, such as `BigQueryIO.Write.to(String)`, to create an instance of this class.

### Method Summary

All Methods Instance Methods Concrete Methods
`PDone` `apply(PCollection<TableRow> input)` Applies this `PTransform` on the given `InputT`, and returns its `Output`.
`BigQueryIO.Write.CreateDisposition` `getCreateDisposition()` Returns the create disposition.
`protected Coder<Void>` `getDefaultOutputCoder()` Returns the default `Coder` to use for the output of this single-output `PTransform`.
`TableSchema` `getSchema()` Returns the table schema.
`TableReference` `getTable()` Returns the table reference, or `null`.
`boolean` `getValidate()` Returns `true` if table validation is enabled.
`BigQueryIO.Write.WriteDisposition` `getWriteDisposition()` Returns the write disposition.
`BigQueryIO.Write.Bound` `named(String name)` Returns a copy of this write transformation, but with the specified transform name.
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.
`BigQueryIO.Write.Bound` `to(SerializableFunction<BoundedWindow,String> tableSpecFunction)` Returns a copy of this write transformation, but using the specified function to determine which table to write to for each window.
`BigQueryIO.Write.Bound` `to(String tableSpec)` Returns a copy of this write transformation, but writing to the specified table.
`BigQueryIO.Write.Bound` `to(TableReference table)` Returns a copy of this write transformation, but writing to the specified table.
`BigQueryIO.Write.Bound` `toTableReference(SerializableFunction<BoundedWindow,TableReference> tableRefFunction)` Returns a copy of this write transformation, but using the specified function to determine which table to write to for each window.
`void` `validate(PCollection<TableRow> 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.Write.Bound` `withCreateDisposition(BigQueryIO.Write.CreateDisposition createDisposition)` Returns a copy of this write transformation, but using the specified create disposition.
`BigQueryIO.Write.Bound` `withoutValidation()` Returns a copy of this write transformation, but without BigQuery table validation.
`BigQueryIO.Write.Bound` `withSchema(TableSchema schema)` Returns a copy of this write transformation, but using the specified schema for rows to be written.
`BigQueryIO.Write.Bound` `withWriteDisposition(BigQueryIO.Write.WriteDisposition writeDisposition)` Returns a copy of this write transformation, but using the specified write disposition.

### 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`

### Constructor Detail

#### Bound

    @Deprecated
    public Bound()

Deprecated. Should be private. Instead, use one of the factory methods in `BigQueryIO.Write`, such as `BigQueryIO.Write.to(String)`, to create an instance of this class.

### Method Detail

#### named

    public BigQueryIO.Write.Bound named(String name)

Returns a copy of this write transformation, but with the specified transform name.

Does not modify this object.

#### to

    public BigQueryIO.Write.Bound to(String tableSpec)

Returns a copy of this write transformation, but writing to the specified table. Refer to `BigQueryIO.parseTableSpec(String)` for the specification format.

Does not modify this object.

#### to

    public BigQueryIO.Write.Bound to(TableReference table)

Returns a copy of this write transformation, but writing to the specified table.

Does not modify this object.

#### to

    public BigQueryIO.Write.Bound to(SerializableFunction<BoundedWindow,String> tableSpecFunction)

Returns a copy of this write transformation, but using the specified function to determine which table to write to for each window.

Does not modify this object.

`tableSpecFunction` should be deterministic. When given the same window, it should always return the same table specification.

#### toTableReference

    public BigQueryIO.Write.Bound toTableReference(SerializableFunction<BoundedWindow,TableReference> tableRefFunction)

Returns a copy of this write transformation, but using the specified function to determine which table to write to for each window.

Does not modify this object.

`tableRefFunction` should be deterministic. When given the same window, it should always return the same table reference.

#### withSchema

    public BigQueryIO.Write.Bound withSchema(TableSchema schema)

Returns a copy of this write transformation, but using the specified schema for rows to be written.

Does not modify this object.

#### withCreateDisposition

    public BigQueryIO.Write.Bound withCreateDisposition(BigQueryIO.Write.CreateDisposition createDisposition)

Returns a copy of this write transformation, but using the specified create disposition.

Does not modify this object.

#### withWriteDisposition

    public BigQueryIO.Write.Bound withWriteDisposition(BigQueryIO.Write.WriteDisposition writeDisposition)

Returns a copy of this write transformation, but using the specified write disposition.

Does not modify this object.

#### withoutValidation

    public BigQueryIO.Write.Bound withoutValidation()

Returns a copy of this write transformation, but without BigQuery table validation.

Does not modify this object.

#### validate

    public void validate(PCollection<TableRow> 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<PCollection<TableRow>,PDone>`

#### apply

    public PDone apply(PCollection<TableRow> 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<PCollection<TableRow>,PDone>`

#### getDefaultOutputCoder

    protected Coder<Void> 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<PCollection<TableRow>,PDone>`

#### 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<PCollection<TableRow>,PDone>`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`

#### getCreateDisposition

    public BigQueryIO.Write.CreateDisposition getCreateDisposition()

Returns the create disposition.

#### getWriteDisposition

    public BigQueryIO.Write.WriteDisposition getWriteDisposition()

Returns the write disposition.

#### getSchema

    public TableSchema getSchema()

Returns the table schema.

#### getTable

    @Nullable
    public TableReference getTable()

Returns the table reference, or `null`.

#### getValidate

    public boolean getValidate()

Returns `true` if table validation is enabled.