Google Cloud Dataflow SDK for Java, version 1.9.1
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>>
- 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 Modifier and Type Method and Description PCollection<TableRow>
apply(PInput input)
Applies thisPTransform
on the givenInputT
, and returns itsOutput
.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
from(ValueProvider<String> tableSpec)
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.BigQueryIO.Read.Bound
fromQuery(ValueProvider<String> query)
LikefromQuery(String)
, but from aValueProvider
.protected Coder<TableRow>
getDefaultOutputCoder()
Returns the defaultCoder
to use for the output of this single-outputPTransform
.Boolean
getFlattenResults()
Returns true/false if result flattening is enabled/disabled, or null if not applicable.String
getQuery()
Returns the query to be read, ornull
if reading from a table instead.ValueProvider<String>
getQueryProvider()
Returns the query to be read, ornull
if reading from a table instead.TableReference
getTable()
Returns the table to read, ornull
if reading from a query instead.ValueProvider<TableReference>
getTableProvider()
Returns the table to read, ornull
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
-
-
-
-
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 toBigQueryIO.parseTableSpec(String)
for the specification format.Does not modify this object.
-
from
public BigQueryIO.Read.Bound from(ValueProvider<String> tableSpec)
Returns a copy of this transform that reads from the specified table. Refer toBigQueryIO.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()
.
-
fromQuery
public BigQueryIO.Read.Bound fromQuery(ValueProvider<String> query)
LikefromQuery(String)
, but from aValueProvider
.
-
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 classPTransform<PInput,PCollection<TableRow>>
-
apply
public PCollection<TableRow> apply(PInput 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<PInput,PCollection<TableRow>>
-
getDefaultOutputCoder
protected Coder<TableRow> 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<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 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<PInput,PCollection<TableRow>>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
getTableProvider
@Nullable public ValueProvider<TableReference> getTableProvider()
Returns the table to read, ornull
if reading from a query instead.
-
getTable
@Nullable public TableReference getTable()
Returns the table to read, ornull
if reading from a query instead.
-
getQuery
@Nullable public String getQuery()
Returns the query to be read, ornull
if reading from a table instead.
-
getQueryProvider
@Nullable public ValueProvider<String> getQueryProvider()
Returns the query to be read, ornull
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.
-
-