public abstract static class BigQueryIO.TypedRead<T>
extends <any>
BigQueryIO.read(SerializableFunction)
.Modifier and Type | Class and Description |
---|---|
static class |
BigQueryIO.TypedRead.Method
Determines the method used to read data from BigQuery.
|
static class |
BigQueryIO.TypedRead.QueryPriority
An enumeration type for the priority of a query.
|
Constructor and Description |
---|
TypedRead() |
Modifier and Type | Method and Description |
---|---|
PCollection<T> |
expand(PBegin input) |
BigQueryIO.TypedRead<T> |
from(java.lang.String tableSpec)
|
BigQueryIO.TypedRead<T> |
from(TableReference table)
|
BigQueryIO.TypedRead<T> |
from(ValueProvider<java.lang.String> tableSpec)
|
BigQueryIO.TypedRead<T> |
fromQuery(java.lang.String query)
|
BigQueryIO.TypedRead<T> |
fromQuery(ValueProvider<java.lang.String> query)
|
TableReference |
getTable()
|
ValueProvider<TableReference> |
getTableProvider()
|
void |
populateDisplayData(DisplayData.Builder builder) |
BigQueryIO.TypedRead<T> |
usingStandardSql()
|
void |
validate(PipelineOptions options) |
BigQueryIO.TypedRead<T> |
withBeamRowConverters(TypeDescriptor<T> typeDescriptor,
org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.TypedRead.ToBeamRowFunction<T> toRowFn,
org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.TypedRead.FromBeamRowFunction<T> fromRowFn)
Sets the functions to convert elements to/from
Row objects. |
BigQueryIO.TypedRead<T> |
withCoder(Coder<T> coder)
Sets a
Coder for the result of the parse function. |
BigQueryIO.TypedRead<T> |
withKmsKey(java.lang.String kmsKey)
For query sources, use this Cloud KMS key to encrypt any temporary tables created.
|
BigQueryIO.TypedRead<T> |
withMethod(BigQueryIO.TypedRead.Method method)
|
BigQueryIO.TypedRead<T> |
withoutResultFlattening()
|
BigQueryIO.TypedRead<T> |
withoutValidation()
|
BigQueryIO.TypedRead<T> |
withQueryLocation(java.lang.String location)
BigQuery geographic location where the query job will be
executed.
|
BigQueryIO.TypedRead<T> |
withQueryPriority(BigQueryIO.TypedRead.QueryPriority priority)
|
BigQueryIO.TypedRead<T> |
withQueryTempDataset(java.lang.String queryTempDatasetRef)
Temporary dataset reference when using
fromQuery(String) . |
BigQueryIO.TypedRead<T> |
withReadOptions(com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions readOptions)
Deprecated.
Use
withSelectedFields(List) and withRowRestriction(String)
instead. |
BigQueryIO.TypedRead<T> |
withRowRestriction(java.lang.String rowRestriction)
|
BigQueryIO.TypedRead<T> |
withRowRestriction(ValueProvider<java.lang.String> rowRestriction)
Read only rows which match the specified filter, which must be a SQL expression compatible
with Google standard
SQL.
|
BigQueryIO.TypedRead<T> |
withSelectedFields(java.util.List<java.lang.String> selectedFields)
|
BigQueryIO.TypedRead<T> |
withSelectedFields(ValueProvider<java.util.List<java.lang.String>> selectedFields)
Read only the specified fields (columns) from a BigQuery table.
|
BigQueryIO.TypedRead<T> |
withTemplateCompatibility() |
public void validate(PipelineOptions options)
public PCollection<T> expand(PBegin input)
public void populateDisplayData(DisplayData.Builder builder)
@Nullable public ValueProvider<TableReference> getTableProvider()
@Nullable public TableReference getTable()
public BigQueryIO.TypedRead<T> withCoder(Coder<T> coder)
Coder
for the result of the parse function. This may be required if a coder
can not be inferred automatically.public BigQueryIO.TypedRead<T> withKmsKey(java.lang.String kmsKey)
@Experimental(value=SCHEMAS) public BigQueryIO.TypedRead<T> withBeamRowConverters(TypeDescriptor<T> typeDescriptor, org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.TypedRead.ToBeamRowFunction<T> toRowFn, org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.TypedRead.FromBeamRowFunction<T> fromRowFn)
public BigQueryIO.TypedRead<T> from(java.lang.String tableSpec)
public BigQueryIO.TypedRead<T> from(ValueProvider<java.lang.String> tableSpec)
public BigQueryIO.TypedRead<T> fromQuery(java.lang.String query)
public BigQueryIO.TypedRead<T> fromQuery(ValueProvider<java.lang.String> query)
public BigQueryIO.TypedRead<T> from(TableReference table)
public BigQueryIO.TypedRead<T> withoutValidation()
public BigQueryIO.TypedRead<T> withoutResultFlattening()
public BigQueryIO.TypedRead<T> usingStandardSql()
public BigQueryIO.TypedRead<T> withQueryPriority(BigQueryIO.TypedRead.QueryPriority priority)
public BigQueryIO.TypedRead<T> withQueryLocation(java.lang.String location)
public BigQueryIO.TypedRead<T> withQueryTempDataset(java.lang.String queryTempDatasetRef)
fromQuery(String)
. When reading from a query,
BigQuery will create a temporary dataset and a temporary table to store the results of the
query. With this option, you can set an existing dataset to create the temporary table.
BigQueryIO will create a temporary table in that dataset, and will remove it once it is not
needed. No other tables in the dataset will be modified. If your job does not have
permissions to create a new dataset, and you want to use fromQuery(String)
(for
instance, to read from a view), you should use this option. Remember that the dataset must
exist and your job needs permissions to create and remove tables inside that dataset.@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withMethod(BigQueryIO.TypedRead.Method method)
@Deprecated @Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withReadOptions(com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions readOptions)
withSelectedFields(List)
and withRowRestriction(String)
instead.@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withSelectedFields(java.util.List<java.lang.String> selectedFields)
@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withSelectedFields(ValueProvider<java.util.List<java.lang.String>> selectedFields)
Requires BigQueryIO.TypedRead.Method.DIRECT_READ
. Not compatible with fromQuery(String)
.
@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withRowRestriction(java.lang.String rowRestriction)
@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withRowRestriction(ValueProvider<java.lang.String> rowRestriction)
Requires BigQueryIO.TypedRead.Method.DIRECT_READ
. Not compatible with fromQuery(String)
.
@Experimental(value=SOURCE_SINK) public BigQueryIO.TypedRead<T> withTemplateCompatibility()