public interface BigQueryOperations
| Modifier and Type | Method and Description |
|---|---|
org.springframework.util.concurrent.ListenableFuture<Job> |
writeDataToTable(String tableName,
InputStream inputStream,
FormatOptions dataFormatOptions)
Writes data to a specified BigQuery table.
|
org.springframework.util.concurrent.ListenableFuture<Job> |
writeDataToTable(String tableName,
InputStream inputStream,
FormatOptions dataFormatOptions,
Schema schema)
Writes data to a specified BigQuery table with a manually-specified table Schema.
|
org.springframework.util.concurrent.ListenableFuture<Job> writeDataToTable(String tableName, InputStream inputStream, FormatOptions dataFormatOptions)
tableName - 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
operationBigQueryException - if errors occur when loading data to the BigQuery tableorg.springframework.util.concurrent.ListenableFuture<Job> writeDataToTable(String tableName, InputStream inputStream, FormatOptions dataFormatOptions, Schema schema)
Example:
Schema schema = Schema.of(
Field.of("CountyId", StandardSQLTypeName.INT64),
Field.of("State", StandardSQLTypeName.STRING),
Field.of("County", StandardSQLTypeName.STRING)
);
ListenableFuture<Job> bigQueryJobFuture =
bigQueryTemplate.writeDataToTable(
TABLE_NAME, dataFile.getInputStream(), FormatOptions.csv(), schema);
tableName - name of the table to write toinputStream - input stream of the table data to writedataFormatOptions - the format of the data to writeschema - the schema of the table being loadedListenableFuture containing the BigQuery Job indicating completion of
operationBigQueryException - if errors occur when loading data to the BigQuery tableCopyright © 2021. All rights reserved.