@Internal @AutoService(value=SchemaIOProvider.class) public class BigQuerySchemaIOProvider extends java.lang.Object implements SchemaIOProvider
SchemaIOProvider
for reading and writing to BigQuery with BigQueryIO
. For a description of configuration options and other defaults, see configurationSchema()
.Constructor and Description |
---|
BigQuerySchemaIOProvider() |
Modifier and Type | Method and Description |
---|---|
Schema |
configurationSchema()
Returns the expected schema of the configuration object.
|
org.apache.beam.sdk.io.gcp.bigquery.BigQuerySchemaIOProvider.BigQuerySchemaIO |
from(java.lang.String location,
Row configuration,
@Nullable Schema dataSchema)
Produces a SchemaIO given a String representing the data's location, the schema of the data
that resides there, and some IO-specific configuration object.
|
java.lang.String |
identifier()
Returns an id that uniquely represents this IO.
|
PCollection.IsBounded |
isBounded()
Indicates whether the PCollections produced by this transform will contain a bounded or
unbounded number of elements.
|
boolean |
requiresDataSchema()
Indicates whether this transform requires a specified data schema.
|
public java.lang.String identifier()
identifier
in interface SchemaIOProvider
public Schema configurationSchema()
BigQueryHelpers.parseTableSpec(java.lang.String)
. Used as an input
to BigQueryIO.TypedRead.from(String)
or BigQueryIO.Write.to(String)
.
BigQueryIO.TypedRead.fromQuery(String)
.
BigQueryIO.TypedRead.withQueryLocation(String)
.
BigQueryIO.Write.CreateDisposition
. Used as an input to BigQueryIO.Write.withCreateDisposition(BigQueryIO.Write.CreateDisposition)
.
BigQueryIO.TypedRead.withMethod(BigQueryIO.TypedRead.Method)
. Defaults to EXPORT, since
that is the only method that currently offers Beam Schema support.
BigQueryIO.Write.withMethod(BigQueryIO.Write.Method)
.
Currently defaults to STORAGE_WRITE_API.
configurationSchema
in interface SchemaIOProvider
public org.apache.beam.sdk.io.gcp.bigquery.BigQuerySchemaIOProvider.BigQuerySchemaIO from(java.lang.String location, Row configuration, @Nullable Schema dataSchema)
For BigQuery IO, only the configuration object is used. Location and data schema have no effect. Specifying a table and dataset is done through appropriate fields in the configuration object, and the data schema is automatically generated from either the input PCollection or schema of the BigQuery table.
from
in interface SchemaIOProvider
public boolean requiresDataSchema()
requiresDataSchema
in interface SchemaIOProvider
public PCollection.IsBounded isBounded()
isBounded
in interface SchemaIOProvider