@@ -70,6 +70,18 @@ Install Dependencies
7070Samples
7171-------------------------------------------------------------------------------
7272
73+ Simple Application
74+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
75+
76+
77+
78+ To run this sample:
79+
80+ .. code-block :: bash
81+
82+ $ python simple_app.py
83+
84+
7385 Quickstart
7486+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7587
@@ -82,7 +94,7 @@ To run this sample:
8294 $ python quickstart.py
8395
8496
85- Sync query
97+ Query
8698+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8799
88100
@@ -91,26 +103,35 @@ To run this sample:
91103
92104.. code-block :: bash
93105
94- $ python sync_query .py
106+ $ python query .py
95107
96- usage: sync_query.py [-h] query
108+ usage: query.py [-h] [--use_standard_sql]
109+ [--destination_table DESTINATION_TABLE]
110+ query
97111
98- Command-line application to perform synchronous queries in BigQuery.
112+ Command-line application to perform queries in BigQuery.
99113
100114 For more information, see the README.rst.
101115
102116 Example invocation:
103- $ python sync_query.py \
104- ' SELECT corpus FROM `publicdata.samples.shakespeare` GROUP BY corpus'
117+ $ python query.py ' #standardSQL
118+ SELECT corpus
119+ FROM `bigquery-public-data.samples.shakespeare`
120+ GROUP BY corpus
121+ ORDER BY corpus'
105122
106123 positional arguments:
107- query BigQuery SQL Query.
124+ query BigQuery SQL Query.
108125
109126 optional arguments:
110- -h, --help show this help message and exit
127+ -h, --help show this help message and exit
128+ --use_standard_sql Use standard SQL syntax.
129+ --destination_table DESTINATION_TABLE
130+ Destination table to use for results. Example:
131+ my_dataset.my_table
111132
112133
113- Async query
134+ Parameterized Query
114135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
115136
116137
@@ -119,23 +140,29 @@ To run this sample:
119140
120141.. code-block :: bash
121142
122- $ python async_query .py
143+ $ python query_params .py
123144
124- usage: async_query .py [-h] query
145+ usage: query_params .py [-h] {named,positional,array,timestamp,struct} ...
125146
126- Command-line application to perform asynchronous queries in BigQuery.
147+ Command-line app to perform queries with parameters in BigQuery.
127148
128149 For more information, see the README.rst.
129150
130151 Example invocation:
131- $ python async_query .py \
132- ' SELECT corpus FROM `publicdata.samples.shakespeare` GROUP BY corpus '
152+ $ python query_params .py named ' romeoandjuliet ' 100
153+ $ python query_params.py positional ' romeoandjuliet ' 100
133154
134155 positional arguments:
135- query BigQuery SQL Query.
156+ {named,positional,array,timestamp,struct}
157+ samples
158+ named Run a query with named parameters.
159+ positional Run a query with positional parameters.
160+ array Run a query with an array parameter.
161+ timestamp Run a query with a timestamp parameter.
162+ struct Run a query with a struct parameter.
136163
137164 optional arguments:
138- -h, --help show this help message and exit
165+ -h, --help show this help message and exit
139166
140167
141168 Snippets
@@ -202,20 +229,21 @@ To run this sample:
202229
203230 $ python load_data_from_file.py
204231
205- usage: load_data_from_file.py [-h] dataset_name table_name source_file_name
232+ usage: load_data_from_file.py [-h] dataset_id table_id source_file_name
206233
207234 Loads data into BigQuery from a local file.
208235
209236 For more information, see the README.rst.
210237
211238 Example invocation:
212- $ python load_data_from_file.py example_dataset example_table example-data.csv
239+ $ python load_data_from_file.py example_dataset example_table \
240+ example-data.csv
213241
214242 The dataset and table should already exist.
215243
216244 positional arguments:
217- dataset_name
218- table_name
245+ dataset_id
246+ table_id
219247 source_file_name Path to a .csv file to upload.
220248
221249 optional arguments:
@@ -233,25 +261,26 @@ To run this sample:
233261
234262 $ python load_data_from_gcs.py
235263
236- usage: load_data_from_gcs.py [-h] dataset_name table_name source
264+ usage: load_data_from_gcs.py [-h] dataset_id table_id source
237265
238266 Loads data into BigQuery from an object in Google Cloud Storage.
239267
240268 For more information, see the README.rst.
241269
242270 Example invocation:
243- $ python load_data_from_gcs.py example_dataset example_table gs://example-bucket/example-data.csv
271+ $ python load_data_from_gcs.py example_dataset example_table \
272+ gs://example-bucket/example-data.csv
244273
245274 The dataset and table should already exist.
246275
247276 positional arguments:
248- dataset_name
249- table_name
250- source The Google Cloud Storage object to load. Must be in the format
251- gs://bucket_name/object_name
277+ dataset_id
278+ table_id
279+ source The Google Cloud Storage object to load. Must be in the format
280+ gs://bucket_name/object_name
252281
253282 optional arguments:
254- -h, --help show this help message and exit
283+ -h, --help show this help message and exit
255284
256285
257286 Load streaming data
@@ -265,24 +294,25 @@ To run this sample:
265294
266295 $ python stream_data.py
267296
268- usage: stream_data.py [-h] dataset_name table_name json_data
297+ usage: stream_data.py [-h] dataset_id table_id json_data
269298
270299 Loads a single row of data directly into BigQuery.
271300
272301 For more information, see the README.rst.
273302
274303 Example invocation:
275- $ python stream_data.py example_dataset example_table ' ["Gandalf", 2000]'
304+ $ python stream_data.py example_dataset example_table \
305+ ' ["Gandalf", 2000]'
276306
277307 The dataset and table should already exist.
278308
279309 positional arguments:
280- dataset_name
281- table_name
282- json_data The row to load into BigQuery as an array in JSON format.
310+ dataset_id
311+ table_id
312+ json_data The row to load into BigQuery as an array in JSON format.
283313
284314 optional arguments:
285- -h, --help show this help message and exit
315+ -h, --help show this help message and exit
286316
287317
288318 Export data to Cloud Storage
@@ -296,25 +326,26 @@ To run this sample:
296326
297327 $ python export_data_to_gcs.py
298328
299- usage: export_data_to_gcs.py [-h] dataset_name table_name destination
329+ usage: export_data_to_gcs.py [-h] dataset_id table_id destination
300330
301331 Exports data from BigQuery to an object in Google Cloud Storage.
302332
303333 For more information, see the README.rst.
304334
305335 Example invocation:
306- $ python export_data_to_gcs.py example_dataset example_table gs://example-bucket/example-data.csv
336+ $ python export_data_to_gcs.py example_dataset example_table \
337+ gs://example-bucket/example-data.csv
307338
308339 The dataset and table should already exist.
309340
310341 positional arguments:
311- dataset_name
312- table_name
313- destination The desintation Google Cloud Storage object.Must be in the
314- format gs://bucket_name/object_name
342+ dataset_id
343+ table_id
344+ destination The destination Google Cloud Storage object. Must be in the
345+ format gs://bucket_name/object_name
315346
316347 optional arguments:
317- -h, --help show this help message and exit
348+ -h, --help show this help message and exit
318349
319350
320351
0 commit comments