blob: c6109f47c1d5fac1fca7911c7311a7028310c736 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="bigquery_v2.html">BigQuery API</a> . <a href="bigquery_v2.jobs.html">jobs</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#get">get(projectId, jobId)</a></code></p>
79<p class="firstline">Retrieves the specified job by ID.</p>
80<p class="toc_element">
81 <code><a href="#getQueryResults">getQueryResults(projectId, jobId, timeoutMs=None, pageToken=None, maxResults=None, startIndex=None)</a></code></p>
82<p class="firstline">Retrieves the results of a query job.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(projectId, body=None, media_body=None)</a></code></p>
85<p class="firstline">Starts a new asynchronous job.</p>
86<p class="toc_element">
87 <code><a href="#list">list(projectId, projection=None, stateFilter=None, pageToken=None, allUsers=None, maxResults=None)</a></code></p>
88<p class="firstline">Lists all the Jobs in the specified project that were started by the user.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#query">query(projectId, body)</a></code></p>
94<p class="firstline">Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="get">get(projectId, jobId)</code>
98 <pre>Retrieves the specified job by ID.
99
100Args:
101 projectId: string, Project ID of the requested job (required)
102 jobId: string, Job ID of the requested job (required)
103
104Returns:
105 An object of the form:
106
107 {
108 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
109 "state": "A String", # [Output-only] Running state of the job.
110 "errors": [ # [Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
111 {
112 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
113 "message": "A String", # A human-readable description of the error.
114 "reason": "A String", # A short error code that summarizes the error.
115 "location": "A String", # Specifies where the error occurred, if present.
116 },
117 ],
118 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
119 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
120 "message": "A String", # A human-readable description of the error.
121 "reason": "A String", # A short error code that summarizes the error.
122 "location": "A String", # Specifies where the error occurred, if present.
123 },
124 },
125 "kind": "bigquery#job", # [Output-only] The type of the resource.
126 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
127 "load": { # [Output-only] Statistics for a load job.
128 "outputRows": "A String", # [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
129 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
130 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a joad job.
131 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while an import job is in the running state, this value may change.
132 },
133 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
134 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
135 "startTime": "A String", # [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
136 "query": { # [Output-only] Statistics for a query job.
137 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
138 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for this job.
139 },
140 "endTime": "A String", # [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
141 },
142 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
143 "projectId": "A String", # [Required] Project ID being billed for the job.
144 "jobId": "A String", # [Required] ID of the job.
145 },
146 "etag": "A String", # [Output-only] A hash of this resource.
147 "configuration": { # [Required] Describes the job configuration.
148 "load": { # [Pick one] Configures a load job.
149 "encoding": "A String", # [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
150 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
151 "sourceFormat": "A String", # [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". The default value is CSV.
152 "destinationTable": { # [Required] The destination table to load the data into.
153 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
154 "tableId": "A String", # [Required] ID of the table.
155 "datasetId": "A String", # [Required] ID of the dataset containing the table.
156 },
157 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
158 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an 'invalid' error is returned in the job result and the job fails. The default value is 0, which requires that all records are valid.
159 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. Default is false which treats short rows as errors. Only applicable to CSV, ignored for other formats.
160 "skipLeadingRows": 42, # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
161 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data on Google Cloud Storage.
162 "A String",
163 ],
164 "quote": "A String", # [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
165 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
166 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
167 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
168 "allowQuotedNewlines": True or False, # Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
169 "ignoreUnknownValues": True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false which treats unknown values as errors. For CSV this ignores extra values at the end of a line. For JSON this ignores named values that do not match any column name.
170 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists or if the schema can be inferred from the loaded data.
171 "fields": [ # Describes the fields in a table.
172 {
173 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
174 # Object with schema name: TableFieldSchema
175 ],
176 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
177 "description": "A String", # [Optional] The field description.
178 "name": "A String", # [Required] The field name.
179 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
180 },
181 ],
182 },
183 },
184 "dryRun": True or False, # [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
185 "link": { # [Pick one] Configures a link job.
186 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
187 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
188 "destinationTable": { # [Required] The destination table of the link job.
189 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
190 "tableId": "A String", # [Required] ID of the table.
191 "datasetId": "A String", # [Required] ID of the dataset containing the table.
192 },
193 "sourceUri": [ # [Required] URI of source table to link.
194 "A String",
195 ],
196 },
197 "query": { # [Pick one] Configures a query job.
198 "useQueryCache": True or False, # [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified.
199 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
200 "projectId": "A String", # [Optional] The ID of the container project.
201 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name.
202 },
203 "destinationTable": { # [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results.
204 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
205 "tableId": "A String", # [Required] ID of the table.
206 "datasetId": "A String", # [Required] ID of the dataset containing the table.
207 },
208 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
209 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
210 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destination_table to be set.
211 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
212 "query": "A String", # [Required] BigQuery SQL query to execute.
213 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
214 },
215 "copy": { # [Pick one] Copies a table.
216 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
217 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
218 "destinationTable": { # [Required] The destination table
219 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
220 "tableId": "A String", # [Required] ID of the table.
221 "datasetId": "A String", # [Required] ID of the dataset containing the table.
222 },
223 "sourceTable": { # [Required] Source table to copy.
224 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
225 "tableId": "A String", # [Required] ID of the table.
226 "datasetId": "A String", # [Required] ID of the dataset containing the table.
227 },
228 },
229 "extract": { # [Pick one] Configures an extract job.
230 "destinationUri": "A String", # [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
231 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
232 "destinationFormat": "A String", # [Experimental] Optional and defaults to CSV. Format with which files should be exported. To export to CSV, specify "CSV". Tables with nested or repeated fields cannot be exported as CSV. To export to newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON".
233 "printHeader": True or False, # [Optional] Whether to print out a header row in the results. Default is true.
234 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
235 "A String",
236 ],
237 "sourceTable": { # [Required] A reference to the table being exported.
238 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
239 "tableId": "A String", # [Required] ID of the table.
240 "datasetId": "A String", # [Required] ID of the dataset containing the table.
241 },
242 },
243 },
244 "id": "A String", # [Output-only] Opaque ID field of the job
245 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
246 }</pre>
247</div>
248
249<div class="method">
250 <code class="details" id="getQueryResults">getQueryResults(projectId, jobId, timeoutMs=None, pageToken=None, maxResults=None, startIndex=None)</code>
251 <pre>Retrieves the results of a query job.
252
253Args:
254 projectId: string, Project ID of the query job (required)
255 jobId: string, Job ID of the query job (required)
256 timeoutMs: integer, How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error
257 pageToken: string, Page token, returned by a previous call, to request the next page of results
258 maxResults: integer, Maximum number of results to read
259 startIndex: string, Zero-based index of the starting row
260
261Returns:
262 An object of the form:
263
264 {
265 "kind": "bigquery#getQueryResultsResponse", # The resource type of the response.
266 "rows": [ # An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully.
267 { # Represents a single row in the result set, consisting of one or more fields.
268 "f": [
269 { # Represents a single cell in the result set. Users of the java client can detect whether their value result is null by calling 'com.google.api.client.util.Data.isNull(cell.getV())'.
270 "v": "",
271 },
272 ],
273 },
274 ],
275 "jobReference": { # Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
276 "projectId": "A String", # [Required] Project ID being billed for the job.
277 "jobId": "A String", # [Required] ID of the job.
278 },
279 "pageToken": "A String", # A token used for paging results.
280 "jobComplete": True or False, # Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
281 "totalRows": "A String", # The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully.
282 "cacheHit": True or False, # Whether the query result was fetched from the query cache.
283 "etag": "A String", # A hash of this response.
284 "schema": { # The schema of the results. Present only when the query completes successfully.
285 "fields": [ # Describes the fields in a table.
286 {
287 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
288 # Object with schema name: TableFieldSchema
289 ],
290 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
291 "description": "A String", # [Optional] The field description.
292 "name": "A String", # [Required] The field name.
293 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
294 },
295 ],
296 },
297 }</pre>
298</div>
299
300<div class="method">
301 <code class="details" id="insert">insert(projectId, body=None, media_body=None)</code>
302 <pre>Starts a new asynchronous job.
303
304Args:
305 projectId: string, Project ID of the project that will be billed for the job (required)
306 body: object, The request body.
307 The object takes the form of:
308
309{
310 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
311 "state": "A String", # [Output-only] Running state of the job.
312 "errors": [ # [Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
313 {
314 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
315 "message": "A String", # A human-readable description of the error.
316 "reason": "A String", # A short error code that summarizes the error.
317 "location": "A String", # Specifies where the error occurred, if present.
318 },
319 ],
320 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
321 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
322 "message": "A String", # A human-readable description of the error.
323 "reason": "A String", # A short error code that summarizes the error.
324 "location": "A String", # Specifies where the error occurred, if present.
325 },
326 },
327 "kind": "bigquery#job", # [Output-only] The type of the resource.
328 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
329 "load": { # [Output-only] Statistics for a load job.
330 "outputRows": "A String", # [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
331 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
332 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a joad job.
333 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while an import job is in the running state, this value may change.
334 },
335 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
336 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
337 "startTime": "A String", # [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
338 "query": { # [Output-only] Statistics for a query job.
339 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
340 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for this job.
341 },
342 "endTime": "A String", # [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
343 },
344 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
345 "projectId": "A String", # [Required] Project ID being billed for the job.
346 "jobId": "A String", # [Required] ID of the job.
347 },
348 "etag": "A String", # [Output-only] A hash of this resource.
349 "configuration": { # [Required] Describes the job configuration.
350 "load": { # [Pick one] Configures a load job.
351 "encoding": "A String", # [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
352 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
353 "sourceFormat": "A String", # [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". The default value is CSV.
354 "destinationTable": { # [Required] The destination table to load the data into.
355 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
356 "tableId": "A String", # [Required] ID of the table.
357 "datasetId": "A String", # [Required] ID of the dataset containing the table.
358 },
359 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
360 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an 'invalid' error is returned in the job result and the job fails. The default value is 0, which requires that all records are valid.
361 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. Default is false which treats short rows as errors. Only applicable to CSV, ignored for other formats.
362 "skipLeadingRows": 42, # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
363 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data on Google Cloud Storage.
364 "A String",
365 ],
366 "quote": "A String", # [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
367 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
368 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
369 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
370 "allowQuotedNewlines": True or False, # Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
371 "ignoreUnknownValues": True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false which treats unknown values as errors. For CSV this ignores extra values at the end of a line. For JSON this ignores named values that do not match any column name.
372 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists or if the schema can be inferred from the loaded data.
373 "fields": [ # Describes the fields in a table.
374 {
375 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
376 # Object with schema name: TableFieldSchema
377 ],
378 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
379 "description": "A String", # [Optional] The field description.
380 "name": "A String", # [Required] The field name.
381 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
382 },
383 ],
384 },
385 },
386 "dryRun": True or False, # [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
387 "link": { # [Pick one] Configures a link job.
388 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
389 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
390 "destinationTable": { # [Required] The destination table of the link job.
391 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
392 "tableId": "A String", # [Required] ID of the table.
393 "datasetId": "A String", # [Required] ID of the dataset containing the table.
394 },
395 "sourceUri": [ # [Required] URI of source table to link.
396 "A String",
397 ],
398 },
399 "query": { # [Pick one] Configures a query job.
400 "useQueryCache": True or False, # [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified.
401 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
402 "projectId": "A String", # [Optional] The ID of the container project.
403 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name.
404 },
405 "destinationTable": { # [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results.
406 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
407 "tableId": "A String", # [Required] ID of the table.
408 "datasetId": "A String", # [Required] ID of the dataset containing the table.
409 },
410 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
411 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
412 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destination_table to be set.
413 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
414 "query": "A String", # [Required] BigQuery SQL query to execute.
415 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
416 },
417 "copy": { # [Pick one] Copies a table.
418 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
419 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
420 "destinationTable": { # [Required] The destination table
421 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
422 "tableId": "A String", # [Required] ID of the table.
423 "datasetId": "A String", # [Required] ID of the dataset containing the table.
424 },
425 "sourceTable": { # [Required] Source table to copy.
426 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
427 "tableId": "A String", # [Required] ID of the table.
428 "datasetId": "A String", # [Required] ID of the dataset containing the table.
429 },
430 },
431 "extract": { # [Pick one] Configures an extract job.
432 "destinationUri": "A String", # [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
433 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
434 "destinationFormat": "A String", # [Experimental] Optional and defaults to CSV. Format with which files should be exported. To export to CSV, specify "CSV". Tables with nested or repeated fields cannot be exported as CSV. To export to newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON".
435 "printHeader": True or False, # [Optional] Whether to print out a header row in the results. Default is true.
436 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
437 "A String",
438 ],
439 "sourceTable": { # [Required] A reference to the table being exported.
440 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
441 "tableId": "A String", # [Required] ID of the table.
442 "datasetId": "A String", # [Required] ID of the dataset containing the table.
443 },
444 },
445 },
446 "id": "A String", # [Output-only] Opaque ID field of the job
447 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
448 }
449
450 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
451
452Returns:
453 An object of the form:
454
455 {
456 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
457 "state": "A String", # [Output-only] Running state of the job.
458 "errors": [ # [Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
459 {
460 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
461 "message": "A String", # A human-readable description of the error.
462 "reason": "A String", # A short error code that summarizes the error.
463 "location": "A String", # Specifies where the error occurred, if present.
464 },
465 ],
466 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
467 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
468 "message": "A String", # A human-readable description of the error.
469 "reason": "A String", # A short error code that summarizes the error.
470 "location": "A String", # Specifies where the error occurred, if present.
471 },
472 },
473 "kind": "bigquery#job", # [Output-only] The type of the resource.
474 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
475 "load": { # [Output-only] Statistics for a load job.
476 "outputRows": "A String", # [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
477 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
478 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a joad job.
479 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while an import job is in the running state, this value may change.
480 },
481 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
482 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
483 "startTime": "A String", # [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
484 "query": { # [Output-only] Statistics for a query job.
485 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
486 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for this job.
487 },
488 "endTime": "A String", # [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
489 },
490 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
491 "projectId": "A String", # [Required] Project ID being billed for the job.
492 "jobId": "A String", # [Required] ID of the job.
493 },
494 "etag": "A String", # [Output-only] A hash of this resource.
495 "configuration": { # [Required] Describes the job configuration.
496 "load": { # [Pick one] Configures a load job.
497 "encoding": "A String", # [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
498 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
499 "sourceFormat": "A String", # [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". The default value is CSV.
500 "destinationTable": { # [Required] The destination table to load the data into.
501 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
502 "tableId": "A String", # [Required] ID of the table.
503 "datasetId": "A String", # [Required] ID of the dataset containing the table.
504 },
505 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
506 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an 'invalid' error is returned in the job result and the job fails. The default value is 0, which requires that all records are valid.
507 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. Default is false which treats short rows as errors. Only applicable to CSV, ignored for other formats.
508 "skipLeadingRows": 42, # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
509 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data on Google Cloud Storage.
510 "A String",
511 ],
512 "quote": "A String", # [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
513 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
514 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
515 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
516 "allowQuotedNewlines": True or False, # Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
517 "ignoreUnknownValues": True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false which treats unknown values as errors. For CSV this ignores extra values at the end of a line. For JSON this ignores named values that do not match any column name.
518 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists or if the schema can be inferred from the loaded data.
519 "fields": [ # Describes the fields in a table.
520 {
521 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
522 # Object with schema name: TableFieldSchema
523 ],
524 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
525 "description": "A String", # [Optional] The field description.
526 "name": "A String", # [Required] The field name.
527 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
528 },
529 ],
530 },
531 },
532 "dryRun": True or False, # [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
533 "link": { # [Pick one] Configures a link job.
534 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
535 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
536 "destinationTable": { # [Required] The destination table of the link job.
537 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
538 "tableId": "A String", # [Required] ID of the table.
539 "datasetId": "A String", # [Required] ID of the dataset containing the table.
540 },
541 "sourceUri": [ # [Required] URI of source table to link.
542 "A String",
543 ],
544 },
545 "query": { # [Pick one] Configures a query job.
546 "useQueryCache": True or False, # [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified.
547 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
548 "projectId": "A String", # [Optional] The ID of the container project.
549 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name.
550 },
551 "destinationTable": { # [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results.
552 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
553 "tableId": "A String", # [Required] ID of the table.
554 "datasetId": "A String", # [Required] ID of the dataset containing the table.
555 },
556 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
557 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
558 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destination_table to be set.
559 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
560 "query": "A String", # [Required] BigQuery SQL query to execute.
561 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
562 },
563 "copy": { # [Pick one] Copies a table.
564 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
565 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
566 "destinationTable": { # [Required] The destination table
567 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
568 "tableId": "A String", # [Required] ID of the table.
569 "datasetId": "A String", # [Required] ID of the dataset containing the table.
570 },
571 "sourceTable": { # [Required] Source table to copy.
572 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
573 "tableId": "A String", # [Required] ID of the table.
574 "datasetId": "A String", # [Required] ID of the dataset containing the table.
575 },
576 },
577 "extract": { # [Pick one] Configures an extract job.
578 "destinationUri": "A String", # [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
579 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
580 "destinationFormat": "A String", # [Experimental] Optional and defaults to CSV. Format with which files should be exported. To export to CSV, specify "CSV". Tables with nested or repeated fields cannot be exported as CSV. To export to newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON".
581 "printHeader": True or False, # [Optional] Whether to print out a header row in the results. Default is true.
582 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
583 "A String",
584 ],
585 "sourceTable": { # [Required] A reference to the table being exported.
586 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
587 "tableId": "A String", # [Required] ID of the table.
588 "datasetId": "A String", # [Required] ID of the dataset containing the table.
589 },
590 },
591 },
592 "id": "A String", # [Output-only] Opaque ID field of the job
593 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
594 }</pre>
595</div>
596
597<div class="method">
598 <code class="details" id="list">list(projectId, projection=None, stateFilter=None, pageToken=None, allUsers=None, maxResults=None)</code>
599 <pre>Lists all the Jobs in the specified project that were started by the user.
600
601Args:
602 projectId: string, Project ID of the jobs to list (required)
603 projection: string, Restrict information returned to a set of selected fields
604 Allowed values
605 full - Includes all job data
606 minimal - Does not include the job configuration
607 stateFilter: string, Filter for job state (repeated)
608 Allowed values
609 done - Finished jobs
610 pending - Pending jobs
611 running - Running jobs
612 pageToken: string, Page token, returned by a previous call, to request the next page of results
613 allUsers: boolean, Whether to display jobs owned by all users in the project. Default false
614 maxResults: integer, Maximum number of results to return
615
616Returns:
617 An object of the form:
618
619 {
620 "nextPageToken": "A String", # A token to request the next page of results.
621 "totalItems": 42, # Total number of jobs in this collection.
622 "kind": "bigquery#jobList", # The resource type of the response.
623 "etag": "A String", # A hash of this page of results.
624 "jobs": [ # List of jobs that were requested.
625 {
626 "status": { # [Full-projection-only] Describes the state of the job.
627 "state": "A String", # [Output-only] Running state of the job.
628 "errors": [ # [Output-only] All errors encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
629 {
630 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
631 "message": "A String", # A human-readable description of the error.
632 "reason": "A String", # A short error code that summarizes the error.
633 "location": "A String", # Specifies where the error occurred, if present.
634 },
635 ],
636 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
637 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
638 "message": "A String", # A human-readable description of the error.
639 "reason": "A String", # A short error code that summarizes the error.
640 "location": "A String", # Specifies where the error occurred, if present.
641 },
642 },
643 "kind": "bigquery#job", # The resource type.
644 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
645 "load": { # [Output-only] Statistics for a load job.
646 "outputRows": "A String", # [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
647 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
648 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a joad job.
649 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while an import job is in the running state, this value may change.
650 },
651 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
652 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
653 "startTime": "A String", # [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
654 "query": { # [Output-only] Statistics for a query job.
655 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
656 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for this job.
657 },
658 "endTime": "A String", # [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
659 },
660 "jobReference": { # Job reference uniquely identifying the job.
661 "projectId": "A String", # [Required] Project ID being billed for the job.
662 "jobId": "A String", # [Required] ID of the job.
663 },
664 "state": "A String", # Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed.
665 "user_email": "A String", # [Full-projection-only] User who ran the job.
666 "configuration": { # [Full-projection-only] Specifies the job configuration.
667 "load": { # [Pick one] Configures a load job.
668 "encoding": "A String", # [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
669 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
670 "sourceFormat": "A String", # [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". The default value is CSV.
671 "destinationTable": { # [Required] The destination table to load the data into.
672 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
673 "tableId": "A String", # [Required] ID of the table.
674 "datasetId": "A String", # [Required] ID of the dataset containing the table.
675 },
676 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
677 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an 'invalid' error is returned in the job result and the job fails. The default value is 0, which requires that all records are valid.
678 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. Default is false which treats short rows as errors. Only applicable to CSV, ignored for other formats.
679 "skipLeadingRows": 42, # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
680 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data on Google Cloud Storage.
681 "A String",
682 ],
683 "quote": "A String", # [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
684 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
685 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
686 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
687 "allowQuotedNewlines": True or False, # Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
688 "ignoreUnknownValues": True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false which treats unknown values as errors. For CSV this ignores extra values at the end of a line. For JSON this ignores named values that do not match any column name.
689 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists or if the schema can be inferred from the loaded data.
690 "fields": [ # Describes the fields in a table.
691 {
692 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
693 # Object with schema name: TableFieldSchema
694 ],
695 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
696 "description": "A String", # [Optional] The field description.
697 "name": "A String", # [Required] The field name.
698 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
699 },
700 ],
701 },
702 },
703 "dryRun": True or False, # [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
704 "link": { # [Pick one] Configures a link job.
705 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
706 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
707 "destinationTable": { # [Required] The destination table of the link job.
708 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
709 "tableId": "A String", # [Required] ID of the table.
710 "datasetId": "A String", # [Required] ID of the dataset containing the table.
711 },
712 "sourceUri": [ # [Required] URI of source table to link.
713 "A String",
714 ],
715 },
716 "query": { # [Pick one] Configures a query job.
717 "useQueryCache": True or False, # [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified.
718 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
719 "projectId": "A String", # [Optional] The ID of the container project.
720 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name.
721 },
722 "destinationTable": { # [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results.
723 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
724 "tableId": "A String", # [Required] ID of the table.
725 "datasetId": "A String", # [Required] ID of the dataset containing the table.
726 },
727 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
728 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
729 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destination_table to be set.
730 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
731 "query": "A String", # [Required] BigQuery SQL query to execute.
732 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
733 },
734 "copy": { # [Pick one] Copies a table.
735 "createDisposition": "A String", # [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
736 "writeDisposition": "A String", # [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
737 "destinationTable": { # [Required] The destination table
738 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
739 "tableId": "A String", # [Required] ID of the table.
740 "datasetId": "A String", # [Required] ID of the dataset containing the table.
741 },
742 "sourceTable": { # [Required] Source table to copy.
743 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
744 "tableId": "A String", # [Required] ID of the table.
745 "datasetId": "A String", # [Required] ID of the dataset containing the table.
746 },
747 },
748 "extract": { # [Pick one] Configures an extract job.
749 "destinationUri": "A String", # [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
750 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
751 "destinationFormat": "A String", # [Experimental] Optional and defaults to CSV. Format with which files should be exported. To export to CSV, specify "CSV". Tables with nested or repeated fields cannot be exported as CSV. To export to newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON".
752 "printHeader": True or False, # [Optional] Whether to print out a header row in the results. Default is true.
753 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
754 "A String",
755 ],
756 "sourceTable": { # [Required] A reference to the table being exported.
757 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
758 "tableId": "A String", # [Required] ID of the table.
759 "datasetId": "A String", # [Required] ID of the dataset containing the table.
760 },
761 },
762 },
763 "id": "A String", # Unique opaque ID of the job.
764 "errorResult": { # A result object that will be present only if the job has failed.
765 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
766 "message": "A String", # A human-readable description of the error.
767 "reason": "A String", # A short error code that summarizes the error.
768 "location": "A String", # Specifies where the error occurred, if present.
769 },
770 },
771 ],
772 }</pre>
773</div>
774
775<div class="method">
776 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
777 <pre>Retrieves the next page of results.
778
779Args:
780 previous_request: The request for the previous page. (required)
781 previous_response: The response from the request for the previous page. (required)
782
783Returns:
784 A request object that you can call 'execute()' on to request the next
785 page. Returns None if there are no more items in the collection.
786 </pre>
787</div>
788
789<div class="method">
790 <code class="details" id="query">query(projectId, body)</code>
791 <pre>Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
792
793Args:
794 projectId: string, Project ID of the project billed for the query (required)
795 body: object, The request body. (required)
796 The object takes the form of:
797
798{
799 "timeoutMs": 42, # [Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 seconds).
800 "kind": "bigquery#queryRequest", # The resource type of the request.
801 "dryRun": True or False, # [Optional] If set, don't actually run the query. A valid query will return an empty response, while an invalid query will return the same error it would if it wasn't a dry run. The default value is false.
802 "useQueryCache": True or False, # [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true.
803 "defaultDataset": { # [Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'.
804 "projectId": "A String", # [Optional] The ID of the container project.
805 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name.
806 },
807 "maxResults": 42, # [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.
808 "query": "A String", # [Required] A query string, following the BigQuery query syntax, of the query to execute. Example: "SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]".
809 "preserveNulls": True or False, # [Deprecated] If set to false, maps null values in the query response to the column's default value. Only specify if you have older code that can not handle null values in the query response. The default value is true. This flag is deprecated and will be ignored in a future version of BigQuery.
810 }
811
812
813Returns:
814 An object of the form:
815
816 {
817 "kind": "bigquery#queryResponse", # The resource type.
818 "rows": [ # An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
819 { # Represents a single row in the result set, consisting of one or more fields.
820 "f": [
821 { # Represents a single cell in the result set. Users of the java client can detect whether their value result is null by calling 'com.google.api.client.util.Data.isNull(cell.getV())'.
822 "v": "",
823 },
824 ],
825 },
826 ],
827 "jobReference": { # Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
828 "projectId": "A String", # [Required] Project ID being billed for the job.
829 "jobId": "A String", # [Required] ID of the job.
830 },
831 "pageToken": "A String", # A token used for paging results.
832 "jobComplete": True or False, # Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
833 "totalRows": "A String", # The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
834 "totalBytesProcessed": "A String", # The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.
835 "cacheHit": True or False, # Whether the query result was fetched from the query cache.
836 "schema": { # The schema of the results. Present only when the query completes successfully.
837 "fields": [ # Describes the fields in a table.
838 {
839 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
840 # Object with schema name: TableFieldSchema
841 ],
842 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
843 "description": "A String", # [Optional] The field description.
844 "name": "A String", # [Required] The field name.
845 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
846 },
847 ],
848 },
849 }</pre>
850</div>
851
852</body></html>