Skip to content

Commit a943d34

Browse files
author
remi Taylor
committed
Update region tags for documentation
1 parent 943b8ba commit a943d34

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

bigquery/tables.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def export_table_data_to_cloud_storage project_id:, dataset_id:, table_id:,
187187
end
188188

189189
def run_query project_id:, query_string:
190-
# [start run_query]
190+
# [START run_query]
191+
# [START get_query_results]
191192
# project_id = "your google cloud project id"
192193
# query_string = "query string to execute (using bigquery query syntax)"
193194

@@ -196,16 +197,19 @@ def run_query project_id:, query_string:
196197
gcloud = Google::Cloud.new project_id
197198
bigquery = gcloud.bigquery
198199

199-
data = bigquery.query query_string
200+
query_results = bigquery.query query_string
201+
# [END get_query_results]
200202

201-
data.each do |row|
203+
# [START display_query_results]
204+
query_results.each do |row|
202205
puts row.inspect
203206
end
204-
# [end run_query]
207+
# [END display_query_results]
208+
# [END run_query]
205209
end
206210

207211
def run_query_as_job project_id:, query_string:
208-
# [start run_query_as_job]
212+
# [START run_query_as_job]
209213
# project_id = "your google cloud project id"
210214
# query_string = "query string to execute (using bigquery query syntax)"
211215

@@ -224,7 +228,7 @@ def run_query_as_job project_id:, query_string:
224228
query_job.query_results.each do |row|
225229
puts row.inspect
226230
end
227-
# [end run_query_as_job]
231+
# [END run_query_as_job]
228232
end
229233

230234
if __FILE__ == $PROGRAM_NAME

0 commit comments

Comments
 (0)