codybythesea
codybythesea

Reputation: 97

Google BigQuery execute() method

I was looking at the Google BigQuery API reference sample Python code, and I came across the execute() call.

Can anyone provide me with documentation on what this call does?

Upvotes: 0

Views: 536

Answers (2)

Jeremy Condit
Jeremy Condit

Reputation: 7046

You linked to code of the form:

bigquery.jobs().insert(...).execute();

The .jobs() call gets an object represent the BigQuery jobs collection.

The .insert(...) call creates a request object representing a (future) call to the BigQuery jobs.insert API method with the specified parameters. But note that this code only constructs the request--it does not actually send the request.

The .execute() call actually sends the API request to the BigQuery API and returns the response.

Note that this is an automatically-generated Java client library for the BigQuery API. The structure of these API clients is similar for all Google APIs.

Upvotes: 2

visc
visc

Reputation: 4959

This page hints at what execute might do in certain scenarios...

https://cloud.google.com/bigquery/querying-data

But it really should be obvious... It executes your query. Probably though a http protocol of some sort.

If you have all of the API in front of you, you should be able to find where execute is defined on certain classes.

execute() is an inherited property of many types of requests from what it seems.

Upvotes: 0

Related Questions