public abstract static class BigQueryIO.Read extends PTransform<PBegin,PCollection<TableRow>>
BigQueryIO.read()
.name
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<TableRow> |
expand(PBegin input)
Applies this
PTransform on the given InputT , and returns its
Output . |
BigQueryIO.Read |
from(java.lang.String tableSpec)
Reads a BigQuery table specified as
"[project_id]:[dataset_id].[table_id]" or
"[dataset_id].[table_id]" for tables within the current project. |
BigQueryIO.Read |
from(TableReference table)
Read from table specified by a
TableReference . |
BigQueryIO.Read |
from(ValueProvider<java.lang.String> tableSpec)
Same as
from(String) , but with a ValueProvider . |
BigQueryIO.Read |
fromQuery(java.lang.String query)
Reads results received after executing the given query.
|
BigQueryIO.Read |
fromQuery(ValueProvider<java.lang.String> query)
Same as
fromQuery(String) , but with a ValueProvider . |
protected Coder<TableRow> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform . |
TableReference |
getTable()
Returns the table to read, or
null if reading from a query instead. |
ValueProvider<TableReference> |
getTableProvider()
Returns the table to read, or
null if reading from a query instead. |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
BigQueryIO.Read |
usingStandardSql()
Enables BigQuery's Standard SQL dialect when reading from a query.
|
void |
validate(PipelineOptions options)
Called before running the Pipeline to verify this transform is fully and correctly
specified.
|
BigQueryIO.Read |
withoutResultFlattening()
Disable flattening of
query results.
|
BigQueryIO.Read |
withoutValidation()
Disable validation that the table exists or the query succeeds prior to pipeline submission.
|
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString
public BigQueryIO.Read from(java.lang.String tableSpec)
"[project_id]:[dataset_id].[table_id]"
or
"[dataset_id].[table_id]"
for tables within the current project.public BigQueryIO.Read from(ValueProvider<java.lang.String> tableSpec)
from(String)
, but with a ValueProvider
.public BigQueryIO.Read fromQuery(java.lang.String query)
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()
.
public BigQueryIO.Read fromQuery(ValueProvider<java.lang.String> query)
fromQuery(String)
, but with a ValueProvider
.public BigQueryIO.Read from(TableReference table)
TableReference
.public BigQueryIO.Read withoutValidation()
public BigQueryIO.Read withoutResultFlattening()
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.
public BigQueryIO.Read usingStandardSql()
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.
public void validate(PipelineOptions options)
PTransform
By default, does nothing.
validate
in class PTransform<PBegin,PCollection<TableRow>>
public PCollection<TableRow> expand(PBegin input)
PTransform
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).
expand
in class PTransform<PBegin,PCollection<TableRow>>
protected Coder<TableRow> getDefaultOutputCoder()
PTransform
Coder
to use for the output of this
single-output PTransform
.
By default, always throws
getDefaultOutputCoder
in class PTransform<PBegin,PCollection<TableRow>>
public void populateDisplayData(DisplayData.Builder builder)
PTransform
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.
populateDisplayData
in interface HasDisplayData
populateDisplayData
in class PTransform<PBegin,PCollection<TableRow>>
builder
- The builder to populate with display data.HasDisplayData
@Nullable public ValueProvider<TableReference> getTableProvider()
null
if reading from a query instead.@Nullable public TableReference getTable()
null
if reading from a query instead.