Class CreateTables<DestinationT,ElementT>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<KV<DestinationT,ElementT>>,PCollection<KV<TableDestination,ElementT>>>
org.apache.beam.sdk.io.gcp.bigquery.CreateTables<DestinationT,ElementT>
- All Implemented Interfaces:
Serializable
,HasDisplayData
public class CreateTables<DestinationT,ElementT>
extends PTransform<PCollection<KV<DestinationT,ElementT>>,PCollection<KV<TableDestination,ElementT>>>
Creates any tables needed before performing streaming writes to the tables. This is a side-effect
DoFn
, and returns the original collection unchanged.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
ConstructorsConstructorDescriptionCreateTables
(BigQueryIO.Write.CreateDisposition createDisposition, DynamicDestinations<?, DestinationT> dynamicDestinations) The list of tables created so far, so we don't try the creation each time. -
Method Summary
Modifier and TypeMethodDescriptionexpand
(PCollection<KV<DestinationT, ElementT>> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
CreateTables
public CreateTables(BigQueryIO.Write.CreateDisposition createDisposition, DynamicDestinations<?, DestinationT> dynamicDestinations) The list of tables created so far, so we don't try the creation each time.TODO: We should put a bound on memory usage of this. Use guava cache instead.
-
-
Method Details
-
expand
public PCollection<KV<TableDestination,ElementT>> expand(PCollection<KV<DestinationT, ElementT>> input) Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.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).
- Specified by:
expand
in classPTransform<PCollection<KV<DestinationT,
ElementT>>, PCollection<KV<TableDestination, ElementT>>>
-