Class BigQueryStorageTableSource<T>
- java.lang.Object
-
- org.apache.beam.sdk.io.Source<T>
-
- org.apache.beam.sdk.io.BoundedSource<T>
-
- org.apache.beam.sdk.io.gcp.bigquery.BigQueryStorageTableSource<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public class BigQueryStorageTableSource<T> extends org.apache.beam.sdk.io.BoundedSource<T>ASourcerepresenting reading from a table.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BigQueryServicesbqServicesprotected @Nullable com.google.cloud.bigquery.storage.v1.DataFormatformatprotected org.apache.beam.sdk.coders.Coder<T>outputCoderprotected org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T>parseFnprotected @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String>rowRestrictionProviderprotected @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>>selectedFieldsProvider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> BigQueryStorageTableSource<T>create(org.apache.beam.sdk.options.ValueProvider<com.google.api.services.bigquery.model.TableReference> tableRefProvider, @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>> selectedFields, @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String> rowRestriction, org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T> parseFn, org.apache.beam.sdk.coders.Coder<T> outputCoder, BigQueryServices bqServices)static <T> BigQueryStorageTableSource<T>create(org.apache.beam.sdk.options.ValueProvider<com.google.api.services.bigquery.model.TableReference> tableRefProvider, com.google.cloud.bigquery.storage.v1.DataFormat format, @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>> selectedFields, @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String> rowRestriction, org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T> parseFn, org.apache.beam.sdk.coders.Coder<T> outputCoder, BigQueryServices bqServices, boolean projectionPushdownApplied)org.apache.beam.sdk.io.BoundedSource.BoundedReader<T>createReader(org.apache.beam.sdk.options.PipelineOptions options)longgetEstimatedSizeBytes(org.apache.beam.sdk.options.PipelineOptions options)org.apache.beam.sdk.coders.Coder<T>getOutputCoder()protected com.google.api.services.bigquery.model.TablegetTargetTable(BigQueryOptions options)Returns the table to read from at split time.protected java.lang.StringgetTargetTableId(BigQueryOptions options)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)java.util.List<org.apache.beam.sdk.io.gcp.bigquery.BigQueryStorageStreamSource<T>>split(long desiredBundleSizeBytes, org.apache.beam.sdk.options.PipelineOptions options)
-
-
-
Field Detail
-
format
protected final @Nullable com.google.cloud.bigquery.storage.v1.DataFormat format
-
selectedFieldsProvider
protected final @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>> selectedFieldsProvider
-
rowRestrictionProvider
protected final @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String> rowRestrictionProvider
-
parseFn
protected final org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T> parseFn
-
outputCoder
protected final org.apache.beam.sdk.coders.Coder<T> outputCoder
-
bqServices
protected final BigQueryServices bqServices
-
-
Method Detail
-
create
public static <T> BigQueryStorageTableSource<T> create(org.apache.beam.sdk.options.ValueProvider<com.google.api.services.bigquery.model.TableReference> tableRefProvider, com.google.cloud.bigquery.storage.v1.DataFormat format, @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>> selectedFields, @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String> rowRestriction, org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T> parseFn, org.apache.beam.sdk.coders.Coder<T> outputCoder, BigQueryServices bqServices, boolean projectionPushdownApplied)
-
create
public static <T> BigQueryStorageTableSource<T> create(org.apache.beam.sdk.options.ValueProvider<com.google.api.services.bigquery.model.TableReference> tableRefProvider, @Nullable org.apache.beam.sdk.options.ValueProvider<java.util.List<java.lang.String>> selectedFields, @Nullable org.apache.beam.sdk.options.ValueProvider<java.lang.String> rowRestriction, org.apache.beam.sdk.transforms.SerializableFunction<SchemaAndRecord,T> parseFn, org.apache.beam.sdk.coders.Coder<T> outputCoder, BigQueryServices bqServices)
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.io.Source<T>
-
getEstimatedSizeBytes
public long getEstimatedSizeBytes(org.apache.beam.sdk.options.PipelineOptions options) throws java.lang.Exception- Specified by:
getEstimatedSizeBytesin classorg.apache.beam.sdk.io.BoundedSource<T>- Throws:
java.lang.Exception
-
getTargetTableId
protected java.lang.String getTargetTableId(BigQueryOptions options) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getTargetTable
protected com.google.api.services.bigquery.model.Table getTargetTable(BigQueryOptions options) throws java.lang.Exception
Returns the table to read from at split time. This is currently never an anonymous table, but it can be a named table which was created to hold the results of a query.- Throws:
java.lang.Exception
-
getOutputCoder
public org.apache.beam.sdk.coders.Coder<T> getOutputCoder()
- Overrides:
getOutputCoderin classorg.apache.beam.sdk.io.Source<T>
-
split
public java.util.List<org.apache.beam.sdk.io.gcp.bigquery.BigQueryStorageStreamSource<T>> split(long desiredBundleSizeBytes, org.apache.beam.sdk.options.PipelineOptions options) throws java.lang.Exception- Specified by:
splitin classorg.apache.beam.sdk.io.BoundedSource<T>- Throws:
java.lang.Exception
-
createReader
public org.apache.beam.sdk.io.BoundedSource.BoundedReader<T> createReader(org.apache.beam.sdk.options.PipelineOptions options) throws java.io.IOException- Specified by:
createReaderin classorg.apache.beam.sdk.io.BoundedSource<T>- Throws:
java.io.IOException
-
-