public class BigQueryTemplate extends Object implements BigQueryOperations
| Constructor and Description |
|---|
BigQueryTemplate(com.google.cloud.bigquery.BigQuery bigQuery,
String datasetName)
Creates the
BigQuery template. |
BigQueryTemplate(com.google.cloud.bigquery.BigQuery bigQuery,
String datasetName,
org.springframework.scheduling.TaskScheduler taskScheduler)
Creates the
BigQuery template. |
| Modifier and Type | Method and Description |
|---|---|
String |
getDatasetName() |
void |
setAutoDetectSchema(boolean autoDetectSchema)
Sets whether BigQuery should attempt to autodetect the schema of the data when loading
data into an empty table for the first time.
|
void |
setJobPollInterval(Duration jobPollInterval)
Sets the
Duration amount of time to wait between successive polls on the status
of a BigQuery job. |
void |
setWriteDisposition(com.google.cloud.bigquery.JobInfo.WriteDisposition writeDisposition)
Sets the
JobInfo.WriteDisposition which specifies how data should be inserted into
BigQuery tables. |
org.springframework.util.concurrent.ListenableFuture<com.google.cloud.bigquery.Job> |
writeDataToTable(String tableName,
InputStream inputStream,
com.google.cloud.bigquery.FormatOptions dataFormatOptions)
Writes data to a specified BigQuery table.
|
public BigQueryTemplate(com.google.cloud.bigquery.BigQuery bigQuery,
String datasetName)
BigQuery template.bigQuery - the underlying client object used to interface with BigQuerydatasetName - the name of the dataset in which all operations will take placepublic BigQueryTemplate(com.google.cloud.bigquery.BigQuery bigQuery,
String datasetName,
org.springframework.scheduling.TaskScheduler taskScheduler)
BigQuery template.bigQuery - the underlying client object used to interface with BigQuerydatasetName - the name of the dataset in which all operations will take placetaskScheduler - the TaskScheduler used to poll for the status of
long-running BigQuery operationspublic void setAutoDetectSchema(boolean autoDetectSchema)
autoDetectSchema - whether data schema should be autodetected from the structure
of the data. Default is true.public void setWriteDisposition(com.google.cloud.bigquery.JobInfo.WriteDisposition writeDisposition)
JobInfo.WriteDisposition which specifies how data should be inserted into
BigQuery tables.writeDisposition - whether to append to or truncate (overwrite) data in the
BigQuery table. Default is WriteDisposition.WRITE_APPEND to append data to
a table.public void setJobPollInterval(Duration jobPollInterval)
Duration amount of time to wait between successive polls on the status
of a BigQuery job.jobPollInterval - the Duration poll interval for BigQuery job status
pollingpublic org.springframework.util.concurrent.ListenableFuture<com.google.cloud.bigquery.Job> writeDataToTable(String tableName, InputStream inputStream, com.google.cloud.bigquery.FormatOptions dataFormatOptions)
BigQueryOperationswriteDataToTable in interface BigQueryOperationstableName - name of the table to write toinputStream - input stream of the table data to writedataFormatOptions - the format of the data to writeListenableFuture containing the BigQuery Job indicating completion of
operationpublic String getDatasetName()
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.