Google Cloud Dataflow SDK for Java, version 1.9.1
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>
APTransform
that can write either a bounded or unboundedPCollection
ofTableRows
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 inBigQueryIO.Write
, such asBigQueryIO.Write.to(String)
, to create an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PDone
apply(PCollection<TableRow> input)
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.BigQueryIO.Write.CreateDisposition
getCreateDisposition()
Returns the create disposition.protected Coder<Void>
getDefaultOutputCoder()
Returns the defaultCoder
to use for the output of this single-outputPTransform
.TableSchema
getSchema()
Returns the table schema.ValueProvider<TableReference>
getTable()
Returns the table reference, ornull
.boolean
getValidate()
Returnstrue
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
to(ValueProvider<String> tableSpec)
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
withSchema(ValueProvider<TableSchema> schema)
LikewithSchema(TableSchema)
, but with aValueProvider
.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
-
-
-
-
Constructor Detail
-
Bound
@Deprecated public Bound()
Deprecated. Should be private. Instead, use one of the factory methods inBigQueryIO.Write
, such asBigQueryIO.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 toBigQueryIO.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.
-
to
public BigQueryIO.Write.Bound to(ValueProvider<String> tableSpec)
Returns a copy of this write transformation, but writing to the specified table. Refer toBigQueryIO.parseTableSpec(String)
for the specification format.Does not modify this object.
-
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.
-
withSchema
public BigQueryIO.Write.Bound withSchema(ValueProvider<TableSchema> schema)
LikewithSchema(TableSchema)
, but with aValueProvider
.
-
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 classPTransform<PCollection<TableRow>,PDone>
-
apply
public PDone apply(PCollection<TableRow> input)
Description copied from class:PTransform
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.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 classPTransform<PCollection<TableRow>,PDone>
-
getDefaultOutputCoder
protected Coder<Void> getDefaultOutputCoder()
Description copied from class:PTransform
Returns the defaultCoder
to use for the output of this single-outputPTransform
.By default, always throws
- Overrides:
getDefaultOutputCoder
in classPTransform<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 viaDisplayData.from(HasDisplayData)
. Implementations may callsuper.populateDisplayData(builder)
in order to register display data in the current namespace, but should otherwise usesubcomponent.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 interfaceHasDisplayData
- Overrides:
populateDisplayData
in classPTransform<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 ValueProvider<TableReference> getTable()
Returns the table reference, ornull
.
-
getValidate
public boolean getValidate()
Returnstrue
if table validation is enabled.
-
-