Package com.google.cloud.bigquery.spi.v2
Class HttpBigQueryRpc
java.lang.Object
com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc
- All Implemented Interfaces:
BigQueryRpc
,com.google.cloud.ServiceRpc
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.cloud.bigquery.spi.v2.BigQueryRpc
BigQueryRpc.Option
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Sends a job cancel request.com.google.api.services.bigquery.model.Dataset
create
(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option, ?> options) Creates a new dataset.com.google.api.services.bigquery.model.Job
create
(com.google.api.services.bigquery.model.Job job, Map<BigQueryRpc.Option, ?> options) Creates a new job.com.google.api.services.bigquery.model.Routine
create
(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option, ?> options) Creates the requested routine.com.google.api.services.bigquery.model.Table
create
(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option, ?> options) Creates a new table.com.google.api.services.bigquery.model.Job
createJobForQuery
(com.google.api.services.bigquery.model.Job job) Creates a new query job.boolean
deleteDataset
(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Delete the requested dataset.boolean
Sends a job delete request.boolean
deleteModel
(String projectId, String datasetId, String modelId) Delete the requested model.boolean
deleteRoutine
(String projectId, String datasetId, String routineId) Deletes the requested routine.boolean
deleteTable
(String projectId, String datasetId, String tableId) Delete the requested table.com.google.api.services.bigquery.model.Dataset
getDataset
(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Returns the requested dataset ornull
if not found.com.google.api.services.bigquery.model.Policy
getIamPolicy
(String resourceId, Map<BigQueryRpc.Option, ?> options) Returns the IAM Policy for the specified resource, using Policy V1.com.google.api.services.bigquery.model.Job
Returns the requested job ornull
if not found.com.google.api.services.bigquery.model.Model
Returns the requested model ornull
if not found.com.google.api.services.bigquery.model.Job
getQueryJob
(String projectId, String jobId, String location) Returns the requested query job ornull
if not found.com.google.api.services.bigquery.model.GetQueryResultsResponse
getQueryResults
(String projectId, String jobId, String location, Map<BigQueryRpc.Option, ?> options) Returns results of the query associated with the provided job.com.google.api.services.bigquery.model.GetQueryResultsResponse
getQueryResultsWithRowLimit
(String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) Returns results of the query with a limit on how many rows of data to pre-fetch associated with the provided job.com.google.api.services.bigquery.model.Routine
getRoutine
(String projectId, String datasetId, String routineId, Map<BigQueryRpc.Option, ?> options) Returns the requested routine ornull
if not found.com.google.api.services.bigquery.model.Table
Returns the requested table ornull
if not found.com.google.api.services.bigquery.model.TableDataInsertAllResponse
insertAll
(String projectId, String datasetId, String tableId, com.google.api.services.bigquery.model.TableDataInsertAllRequest request) Sends an insert all request.listDatasets
(String projectId, Map<BigQueryRpc.Option, ?> options) Lists the provided project's datasets, keyed by page token.listJobs
(String projectId, Map<BigQueryRpc.Option, ?> options) Lists the project's jobs.listModels
(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Lists the dataset's models, keyed by page token.listRoutines
(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) com.google.api.services.bigquery.model.TableDataList
listTableData
(String projectId, String datasetId, String tableId, Map<BigQueryRpc.Option, ?> options) Lists the table's rows.com.google.api.services.bigquery.model.TableDataList
listTableDataWithRowLimit
(String projectId, String datasetId, String tableId, Integer maxResultPerPage, String pageToken) Lists the table's rows with a limit on how many rows of data to pre-fetch.listTables
(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Lists the dataset's tables, keyed by page token.open
(com.google.api.services.bigquery.model.Job loadJob) Opens a resumable upload session to load data into a BigQuery table and returns an upload URI.com.google.api.services.bigquery.model.Dataset
patch
(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option, ?> options) Updates dataset information.com.google.api.services.bigquery.model.Model
patch
(com.google.api.services.bigquery.model.Model model, Map<BigQueryRpc.Option, ?> options) Updates model information.com.google.api.services.bigquery.model.Table
patch
(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option, ?> options) Updates table information.com.google.api.services.bigquery.model.QueryResponse
Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.com.google.api.services.bigquery.model.Policy
setIamPolicy
(String resourceId, com.google.api.services.bigquery.model.Policy policy, Map<BigQueryRpc.Option, ?> options) Updates the IAM policy for the specified resource.com.google.api.services.bigquery.model.TestIamPermissionsResponse
testIamPermissions
(String resourceId, List<String> permissions, Map<BigQueryRpc.Option, ?> options) Tests whether the caller holds the provided permissions for the specified resource.com.google.api.services.bigquery.model.Routine
update
(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option, ?> options) Updates the requested routine.com.google.api.services.bigquery.model.Job
write
(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last) Uploads the provided data to the resumable upload session at the specified position.
-
Field Details
-
DEFAULT_PROJECTION
- See Also:
-
-
Constructor Details
-
HttpBigQueryRpc
-
-
Method Details
-
getDataset
public com.google.api.services.bigquery.model.Dataset getDataset(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the requested dataset ornull
if not found.- Specified by:
getDataset
in interfaceBigQueryRpc
-
listDatasets
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Dataset>> listDatasets(String projectId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Lists the provided project's datasets, keyed by page token. Partial information is returned on a dataset (datasetReference, friendlyName and id). To get full information useBigQueryRpc.getDataset(String, String, Map)
.- Specified by:
listDatasets
in interfaceBigQueryRpc
-
create
public com.google.api.services.bigquery.model.Dataset create(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Creates a new dataset.- Specified by:
create
in interfaceBigQueryRpc
-
create
public com.google.api.services.bigquery.model.Table create(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Creates a new table.- Specified by:
create
in interfaceBigQueryRpc
-
create
public com.google.api.services.bigquery.model.Routine create(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Creates the requested routine.- Specified by:
create
in interfaceBigQueryRpc
-
create
public com.google.api.services.bigquery.model.Job create(com.google.api.services.bigquery.model.Job job, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Creates a new job.- Specified by:
create
in interfaceBigQueryRpc
-
createJobForQuery
public com.google.api.services.bigquery.model.Job createJobForQuery(com.google.api.services.bigquery.model.Job job) Description copied from interface:BigQueryRpc
Creates a new query job.- Specified by:
createJobForQuery
in interfaceBigQueryRpc
-
deleteDataset
Description copied from interface:BigQueryRpc
Delete the requested dataset.- Specified by:
deleteDataset
in interfaceBigQueryRpc
- Returns:
true
if dataset was deleted,false
if it was not found
-
patch
public com.google.api.services.bigquery.model.Dataset patch(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Updates dataset information.- Specified by:
patch
in interfaceBigQueryRpc
-
patch
public com.google.api.services.bigquery.model.Table patch(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Updates table information.- Specified by:
patch
in interfaceBigQueryRpc
-
getTable
public com.google.api.services.bigquery.model.Table getTable(String projectId, String datasetId, String tableId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the requested table ornull
if not found.- Specified by:
getTable
in interfaceBigQueryRpc
-
listTables
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Table>> listTables(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Lists the dataset's tables, keyed by page token. Partial information is returned on a table (tableReference, friendlyName, id and type). To get full information useBigQueryRpc.getTable(String, String, String, Map)
.- Specified by:
listTables
in interfaceBigQueryRpc
-
deleteTable
Description copied from interface:BigQueryRpc
Delete the requested table.- Specified by:
deleteTable
in interfaceBigQueryRpc
- Returns:
true
if table was deleted,false
if it was not found
-
patch
public com.google.api.services.bigquery.model.Model patch(com.google.api.services.bigquery.model.Model model, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Updates model information.- Specified by:
patch
in interfaceBigQueryRpc
-
getModel
public com.google.api.services.bigquery.model.Model getModel(String projectId, String datasetId, String modelId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the requested model ornull
if not found.- Specified by:
getModel
in interfaceBigQueryRpc
-
listModels
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Model>> listModels(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Lists the dataset's models, keyed by page token.- Specified by:
listModels
in interfaceBigQueryRpc
-
deleteModel
Description copied from interface:BigQueryRpc
Delete the requested model.- Specified by:
deleteModel
in interfaceBigQueryRpc
- Returns:
true
if model was deleted,false
if it was not found
-
update
public com.google.api.services.bigquery.model.Routine update(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Updates the requested routine.- Specified by:
update
in interfaceBigQueryRpc
-
getRoutine
public com.google.api.services.bigquery.model.Routine getRoutine(String projectId, String datasetId, String routineId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the requested routine ornull
if not found.- Specified by:
getRoutine
in interfaceBigQueryRpc
-
listRoutines
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Routine>> listRoutines(String projectId, String datasetId, Map<BigQueryRpc.Option, ?> options) - Specified by:
listRoutines
in interfaceBigQueryRpc
-
deleteRoutine
Description copied from interface:BigQueryRpc
Deletes the requested routine.- Specified by:
deleteRoutine
in interfaceBigQueryRpc
- Returns:
true
if routine was deleted,false
if it was not found
-
insertAll
public com.google.api.services.bigquery.model.TableDataInsertAllResponse insertAll(String projectId, String datasetId, String tableId, com.google.api.services.bigquery.model.TableDataInsertAllRequest request) Description copied from interface:BigQueryRpc
Sends an insert all request.- Specified by:
insertAll
in interfaceBigQueryRpc
-
listTableData
public com.google.api.services.bigquery.model.TableDataList listTableData(String projectId, String datasetId, String tableId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Lists the table's rows.- Specified by:
listTableData
in interfaceBigQueryRpc
-
listTableDataWithRowLimit
public com.google.api.services.bigquery.model.TableDataList listTableDataWithRowLimit(String projectId, String datasetId, String tableId, Integer maxResultPerPage, String pageToken) Description copied from interface:BigQueryRpc
Lists the table's rows with a limit on how many rows of data to pre-fetch.- Specified by:
listTableDataWithRowLimit
in interfaceBigQueryRpc
-
getJob
public com.google.api.services.bigquery.model.Job getJob(String projectId, String jobId, String location, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the requested job ornull
if not found.- Specified by:
getJob
in interfaceBigQueryRpc
-
getQueryJob
public com.google.api.services.bigquery.model.Job getQueryJob(String projectId, String jobId, String location) Description copied from interface:BigQueryRpc
Returns the requested query job ornull
if not found.- Specified by:
getQueryJob
in interfaceBigQueryRpc
-
listJobs
public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Job>> listJobs(String projectId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Lists the project's jobs.- Specified by:
listJobs
in interfaceBigQueryRpc
-
cancel
Description copied from interface:BigQueryRpc
Sends a job cancel request. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully.- Specified by:
cancel
in interfaceBigQueryRpc
- Returns:
true
if cancel was requested successfully,false
if the job was not found
-
deleteJob
Description copied from interface:BigQueryRpc
Sends a job delete request.- Specified by:
deleteJob
in interfaceBigQueryRpc
- Returns:
true
if delete was successful,false
if the job was not found
-
getQueryResults
public com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResults(String projectId, String jobId, String location, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns results of the query associated with the provided job.- Specified by:
getQueryResults
in interfaceBigQueryRpc
-
getQueryResultsWithRowLimit
public com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) Description copied from interface:BigQueryRpc
Returns results of the query with a limit on how many rows of data to pre-fetch associated with the provided job.- Specified by:
getQueryResultsWithRowLimit
in interfaceBigQueryRpc
-
queryRpc
public com.google.api.services.bigquery.model.QueryResponse queryRpc(String projectId, com.google.api.services.bigquery.model.QueryRequest content) Description copied from interface:BigQueryRpc
Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.Create a request for the method "jobs.query".
This request holds the parameters needed by the bigquery server. After setting any optional parameters, call the
AbstractGoogleClientRequest.execute()
method to invoke the remote operation.- Specified by:
queryRpc
in interfaceBigQueryRpc
- Parameters:
projectId
- Project ID of the project billed for the querycontent
- theQueryRequest
- Returns:
- the request
-
open
Description copied from interface:BigQueryRpc
Opens a resumable upload session to load data into a BigQuery table and returns an upload URI.- Specified by:
open
in interfaceBigQueryRpc
- Parameters:
loadJob
- load job
-
write
public com.google.api.services.bigquery.model.Job write(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last) Description copied from interface:BigQueryRpc
Uploads the provided data to the resumable upload session at the specified position. This method returns the job created to insert the rows, only whenlast
istrue
.- Specified by:
write
in interfaceBigQueryRpc
- Parameters:
uploadId
- the resumable upload session URItoWrite
- a byte array of data to uploadtoWriteOffset
- offset in thetoWrite
param to start writing fromdestOffset
- offset in the destination where to upload data tolength
- the number of bytes to uploadlast
-true
indicates that the last chunk is being uploaded- Returns:
- returns the job created to insert the rows, only when
last
istrue
. Returnsnull
otherwise
-
getIamPolicy
public com.google.api.services.bigquery.model.Policy getIamPolicy(String resourceId, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Returns the IAM Policy for the specified resource, using Policy V1.- Specified by:
getIamPolicy
in interfaceBigQueryRpc
-
setIamPolicy
public com.google.api.services.bigquery.model.Policy setIamPolicy(String resourceId, com.google.api.services.bigquery.model.Policy policy, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Updates the IAM policy for the specified resource.- Specified by:
setIamPolicy
in interfaceBigQueryRpc
-
testIamPermissions
public com.google.api.services.bigquery.model.TestIamPermissionsResponse testIamPermissions(String resourceId, List<String> permissions, Map<BigQueryRpc.Option, ?> options) Description copied from interface:BigQueryRpc
Tests whether the caller holds the provided permissions for the specified resource. Returns the subset of permissions the caller actually holds.- Specified by:
testIamPermissions
in interfaceBigQueryRpc
-