@@ -35,7 +35,7 @@ var bigquery = gcloud.bigquery();
35
35
36
36
// [START sync_query]
37
37
/**
38
- * Run an example synchronous query.
38
+ * Run a synchronous query.
39
39
* @param {object } queryObj The BigQuery query to run, plus any additional options
40
40
* listed at https://cloud.google.com/bigquery/docs/reference/v2/jobs/query
41
41
* @param {function } callback Callback function to receive query results.
@@ -58,7 +58,7 @@ function syncQuery (queryObj, callback) {
58
58
59
59
// [START async_query]
60
60
/**
61
- * Run an example asynchronous query.
61
+ * Run an asynchronous query.
62
62
* @param {object } queryObj The BigQuery query to run, plus any additional options
63
63
* listed at https://cloud.google.com/bigquery/docs/reference/v2/jobs/query
64
64
* @param {function } callback Callback function to receive job data.
@@ -81,7 +81,7 @@ function asyncQuery (queryObj, callback) {
81
81
/**
82
82
* Poll an asynchronous query job for results.
83
83
* @param {object } jobId The ID of the BigQuery job to poll.
84
- * @param {function } callback Callback function to receive job data .
84
+ * @param {function } callback Callback function to receive query results .
85
85
*/
86
86
function asyncPoll ( jobId , callback ) {
87
87
if ( ! jobId ) {
@@ -96,7 +96,7 @@ function asyncPoll (jobId, callback) {
96
96
}
97
97
console . log ( 'Job status: %s' , metadata . status . state ) ;
98
98
99
- // If job is done, get query results
99
+ // If job is done, get query results; if not, return an error.
100
100
if ( metadata . status . state === 'DONE' ) {
101
101
job . getQueryResults ( function ( err , rows ) {
102
102
if ( err ) {
0 commit comments