Class FakeBigQueryServices
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.testing.FakeBigQueryServices
-
- All Implemented Interfaces:
java.io.Serializable
,BigQueryServices
@Internal public class FakeBigQueryServices extends java.lang.Object implements BigQueryServices
A fake implementation of BigQuery's query service..- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FakeBigQueryServices.FakeBigQueryServerStream<T>
An implementation ofBigQueryServices.BigQueryServerStream
which takes aList
as theIterable
to simulate a server stream.-
Nested classes/interfaces inherited from interface org.apache.beam.sdk.io.gcp.bigquery.BigQueryServices
BigQueryServices.BigQueryServerStream<T>, BigQueryServices.DatasetService, BigQueryServices.JobService, BigQueryServices.StorageClient, BigQueryServices.StreamAppendClient
-
-
Constructor Summary
Constructors Constructor Description FakeBigQueryServices()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.google.api.services.bigquery.model.TableRow
convertNumbers(com.google.api.services.bigquery.model.TableRow tableRow)
static org.apache.beam.sdk.values.KV<com.google.api.services.bigquery.model.Table,java.util.List<com.google.api.services.bigquery.model.TableRow>>
decodeQueryResult(java.lang.String queryResult)
static java.lang.String
encodeQueryResult(com.google.api.services.bigquery.model.Table table)
static java.lang.String
encodeQueryResult(com.google.api.services.bigquery.model.Table table, java.util.List<com.google.api.services.bigquery.model.TableRow> rows)
BigQueryServices.DatasetService
getDatasetService(BigQueryOptions bqOptions)
Returns a real, mock, or fakeBigQueryServices.DatasetService
.BigQueryServices.JobService
getJobService(BigQueryOptions bqOptions)
Returns a real, mock, or fakeBigQueryServices.JobService
.BigQueryServices.StorageClient
getStorageClient(BigQueryOptions bqOptions)
Returns a real, mock, or fakeBigQueryServices.StorageClient
.FakeBigQueryServices
withDatasetService(FakeDatasetService datasetService)
FakeBigQueryServices
withJobService(BigQueryServices.JobService jobService)
FakeBigQueryServices
withStorageClient(BigQueryServices.StorageClient storageClient)
-
-
-
Method Detail
-
withJobService
public FakeBigQueryServices withJobService(BigQueryServices.JobService jobService)
-
withDatasetService
public FakeBigQueryServices withDatasetService(FakeDatasetService datasetService)
-
withStorageClient
public FakeBigQueryServices withStorageClient(BigQueryServices.StorageClient storageClient)
-
getJobService
public BigQueryServices.JobService getJobService(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServices
Returns a real, mock, or fakeBigQueryServices.JobService
.- Specified by:
getJobService
in interfaceBigQueryServices
-
getDatasetService
public BigQueryServices.DatasetService getDatasetService(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServices
Returns a real, mock, or fakeBigQueryServices.DatasetService
.- Specified by:
getDatasetService
in interfaceBigQueryServices
-
getStorageClient
public BigQueryServices.StorageClient getStorageClient(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServices
Returns a real, mock, or fakeBigQueryServices.StorageClient
.- Specified by:
getStorageClient
in interfaceBigQueryServices
-
encodeQueryResult
public static java.lang.String encodeQueryResult(com.google.api.services.bigquery.model.Table table) throws java.io.IOException
- Throws:
java.io.IOException
-
encodeQueryResult
public static java.lang.String encodeQueryResult(com.google.api.services.bigquery.model.Table table, java.util.List<com.google.api.services.bigquery.model.TableRow> rows) throws java.io.IOException
- Throws:
java.io.IOException
-
decodeQueryResult
public static org.apache.beam.sdk.values.KV<com.google.api.services.bigquery.model.Table,java.util.List<com.google.api.services.bigquery.model.TableRow>> decodeQueryResult(java.lang.String queryResult) throws java.io.IOException
- Throws:
java.io.IOException
-
convertNumbers
public static com.google.api.services.bigquery.model.TableRow convertNumbers(com.google.api.services.bigquery.model.TableRow tableRow)
-
-