blob: eefb2d827596ea844c3064cf1166ae1dca12aa50 [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">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000078 <code><a href="#cancel">cancel(projectId, jobId)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070079<p class="firstline">Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.</p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000080<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -040081 <code><a href="#get">get(projectId, jobId)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000082<p class="firstline">Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
84 <code><a href="#getQueryResults">getQueryResults(projectId, jobId, timeoutMs=None, pageToken=None, maxResults=None, startIndex=None)</a></code></p>
85<p class="firstline">Retrieves the results of a query job.</p>
86<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040087 <code><a href="#getQueryResults_next">getQueryResults_next(previous_request, previous_response)</a></code></p>
88<p class="firstline">Retrieves the next page of results.</p>
89<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080090 <code><a href="#insert">insert(projectId, body=None, media_body=None, media_mime_type=None)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000091<p class="firstline">Starts a new asynchronous job. Requires the Can View project role.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
93 <code><a href="#list">list(projectId, projection=None, stateFilter=None, pageToken=None, allUsers=None, maxResults=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070094<p class="firstline">Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.</p>
John Asmuth614db982014-04-24 15:46:26 -040095<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
99 <code><a href="#query">query(projectId, body)</a></code></p>
100<p class="firstline">Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.</p>
101<h3>Method Details</h3>
102<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000103 <code class="details" id="cancel">cancel(projectId, jobId)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700104 <pre>Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000105
106Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800107 projectId: string, [Required] Project ID of the job to cancel (required)
108 jobId: string, [Required] Job ID of the job to cancel (required)
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000109
110Returns:
111 An object of the form:
112
113 {
114 "job": { # The final state of the job.
115 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
116 "state": "A String", # [Output-only] Running state of the job.
117 "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.
118 {
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 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
126 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
127 "message": "A String", # A human-readable description of the error.
128 "reason": "A String", # A short error code that summarizes the error.
129 "location": "A String", # Specifies where the error occurred, if present.
130 },
131 },
132 "kind": "bigquery#job", # [Output-only] The type of the resource.
133 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
134 "load": { # [Output-only] Statistics for a load job.
135 "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.
136 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700137 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a load job.
138 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000139 },
140 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
141 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
142 "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.
143 "query": { # [Output-only] Statistics for a query job.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400144 "queryPlan": [ # [Output-only, Experimental] Describes execution plan for the query.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800145 {
146 "computeRatioMax": 3.14, # Relative amount of time the slowest shard spent on CPU-bound tasks.
147 "recordsWritten": "A String", # Number of records written by the stage.
148 "waitRatioMax": 3.14, # Relative amount of time the slowest shard spent waiting to be scheduled.
149 "readRatioAvg": 3.14, # Relative amount of time the average shard spent reading input.
150 "readRatioMax": 3.14, # Relative amount of time the slowest shard spent reading input.
151 "steps": [ # List of operations within the stage in dependency order (approximately chronological).
152 {
153 "kind": "A String", # Machine-readable operation type.
154 "substeps": [ # Human-readable stage descriptions.
155 "A String",
156 ],
157 },
158 ],
159 "recordsRead": "A String", # Number of records read into the stage.
160 "computeRatioAvg": 3.14, # Relative amount of time the average shard spent on CPU-bound tasks.
161 "writeRatioMax": 3.14, # Relative amount of time the slowest shard spent on writing output.
162 "writeRatioAvg": 3.14, # Relative amount of time the average shard spent on writing output.
163 "waitRatioAvg": 3.14, # Relative amount of time the average shard spent waiting to be scheduled.
164 "id": "A String", # Unique ID for stage within plan.
165 "name": "A String", # Human-readable name for stage.
166 },
167 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800168 "statementType": "A String", # [Output-only, Experimental] The type of query statement, if valid.
Takashi Matsuo06694102015-09-11 13:55:40 -0700169 "totalBytesBilled": "A String", # [Output-only] Total bytes billed for the job.
170 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for the job.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800171 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700172 "undeclaredQueryParameters": [ # [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.
173 {
174 "parameterType": { # [Required] The type of this parameter.
175 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
176 {
177 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
178 "description": "A String", # [Optional] Human-oriented description of the field.
179 "name": "A String", # [Optional] The name of this field.
180 },
181 ],
182 "type": "A String", # [Required] The top level type of this field.
183 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
184 },
185 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700186 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
187 "a_key": # Object with schema name: QueryParameterValue
188 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700189 "arrayValues": [ # [Optional] The array values, if this is an array type.
190 # Object with schema name: QueryParameterValue
191 ],
192 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
193 },
194 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
195 },
196 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400197 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800198 "billingTier": 42, # [Output-only] Billing tier for the job.
199 "referencedTables": [ # [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
200 {
201 "projectId": "A String", # [Required] The ID of the project containing this table.
202 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
203 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
204 },
205 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700206 "schema": { # [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
207 "fields": [ # Describes the fields in a table.
208 {
209 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
210 # Object with schema name: TableFieldSchema
211 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800212 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700213 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
214 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
215 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
216 },
217 ],
218 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000219 },
220 "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.
221 "extract": { # [Output-only] Statistics for an extract job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700222 "destinationUriFileCounts": [ # [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000223 "A String",
224 ],
225 },
226 },
227 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
228 "projectId": "A String", # [Required] The ID of the project containing this job.
229 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
230 },
231 "etag": "A String", # [Output-only] A hash of this resource.
232 "user_email": "A String", # [Output-only] Email address of the user who ran the job.
233 "configuration": { # [Required] Describes the job configuration.
234 "load": { # [Pick one] Configures a load job.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800235 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
236 "A String",
237 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000238 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800239 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. 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 (',').
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400240 "autodetect": True or False, # [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800241 "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". For Avro, specify "AVRO". The default value is CSV.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000242 "destinationTable": { # [Required] The destination table to load the data into.
243 "projectId": "A String", # [Required] The ID of the project containing this table.
244 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
245 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
246 },
247 "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_APPEND. 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.
248 "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. The default value is 0, which requires that all records are valid.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400249 "nullMarker": "A String", # [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000250 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
251 "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.
252 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
253 "A String",
254 ],
255 "quote": """, # [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.
256 "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.
257 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
258 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
259 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400260 "projectionFields": [ # [Experimental] If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000261 "A String",
262 ],
263 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800264 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000265 "fields": [ # Describes the fields in a table.
266 {
267 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
268 # Object with schema name: TableFieldSchema
269 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800270 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000271 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
272 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
273 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
274 },
275 ],
276 },
277 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800278 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400279 "labels": { # [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700280 "a_key": "A String",
281 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800282 "query": { # [Pick one] Configures a query job.
283 "flattenResults": true, # [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.
284 "maximumBillingTier": 1, # [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
285 "useQueryCache": true, # [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. The default value is true.
286 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
287 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
288 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
289 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800290 "useLegacySql": True or False, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800291 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000292 "projectId": "A String", # [Required] The ID of the project containing this table.
293 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
294 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
295 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700296 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700297 "A String",
298 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800299 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
300 "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.
301 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400302 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700303 {
304 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
305 "inlineCode": "A String", # [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
306 },
307 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700308 "queryParameters": [ # Query parameters for standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700309 {
310 "parameterType": { # [Required] The type of this parameter.
311 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
312 {
313 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
314 "description": "A String", # [Optional] Human-oriented description of the field.
315 "name": "A String", # [Optional] The name of this field.
316 },
317 ],
318 "type": "A String", # [Required] The top level type of this field.
319 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
320 },
321 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700322 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
323 "a_key": # Object with schema name: QueryParameterValue
324 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700325 "arrayValues": [ # [Optional] The array values, if this is an array type.
326 # Object with schema name: QueryParameterValue
327 ],
328 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
329 },
330 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
331 },
332 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800333 "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.
334 "query": "A String", # [Required] BigQuery SQL query to execute.
335 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700336 "maximumBytesBilled": "A String", # [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800337 "tableDefinitions": { # [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
338 "a_key": {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700339 "compression": "A String", # [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800340 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
341 "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 (',').
342 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700343 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800344 "allowJaggedRows": True or False, # [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
345 "quote": """, # [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.
346 "allowQuotedNewlines": True or False, # [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
347 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400348 "autodetect": True or False, # [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700349 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
350 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
351 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800352 "A String",
353 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700354 "bigtableOptions": { # [Optional] Additional options if sourceFormat is set to BIGTABLE.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700355 "readRowkeyAsString": True or False, # [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700356 "ignoreUnspecifiedColumnFamilies": True or False, # [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
357 "columnFamilies": [ # [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
358 {
359 "familyId": "A String", # Identifier of the column family.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700360 "type": "A String", # [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700361 "onlyReadLatest": True or False, # [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
362 "columns": [ # [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
363 {
364 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
365 "qualifierEncoded": "A String", # [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
366 "fieldName": "A String", # [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
367 "onlyReadLatest": True or False, # [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
368 "qualifierString": "A String",
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700369 "type": "A String", # [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700370 },
371 ],
372 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
373 },
374 ],
375 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400376 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700377 "googleSheetsOptions": { # [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
378 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
379 },
380 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800381 "fields": [ # Describes the fields in a table.
382 {
383 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
384 # Object with schema name: TableFieldSchema
385 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800386 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800387 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
388 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
389 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
390 },
391 ],
392 },
393 },
394 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400395 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000396 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700397 "copy": { # [Pick one] Copies a table.
398 "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.
399 "sourceTables": [ # [Pick one] Source tables to copy.
400 {
401 "projectId": "A String", # [Required] The ID of the project containing this table.
402 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
403 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
404 },
405 ],
406 "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.
407 "destinationTable": { # [Required] The destination table
408 "projectId": "A String", # [Required] The ID of the project containing this table.
409 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
410 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
411 },
412 "sourceTable": { # [Pick one] Source table to copy.
413 "projectId": "A String", # [Required] The ID of the project containing this table.
414 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
415 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
416 },
417 },
418 "extract": { # [Pick one] Configures an extract job.
419 "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.
420 "compression": "A String", # [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE.
421 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
422 "destinationFormat": "A String", # [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV.
423 "printHeader": true, # [Optional] Whether to print out a header row in the results. Default is true.
424 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
425 "A String",
426 ],
427 "sourceTable": { # [Required] A reference to the table being exported.
428 "projectId": "A String", # [Required] The ID of the project containing this table.
429 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
430 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
431 },
432 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000433 },
434 "id": "A String", # [Output-only] Opaque ID field of the job
435 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
436 },
437 "kind": "bigquery#jobCancelResponse", # The resource type of the response.
438 }</pre>
439</div>
440
441<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400442 <code class="details" id="get">get(projectId, jobId)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000443 <pre>Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
John Asmuth614db982014-04-24 15:46:26 -0400444
445Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800446 projectId: string, [Required] Project ID of the requested job (required)
447 jobId: string, [Required] Job ID of the requested job (required)
John Asmuth614db982014-04-24 15:46:26 -0400448
449Returns:
450 An object of the form:
451
452 {
453 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
454 "state": "A String", # [Output-only] Running state of the job.
455 "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.
456 {
457 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
458 "message": "A String", # A human-readable description of the error.
459 "reason": "A String", # A short error code that summarizes the error.
460 "location": "A String", # Specifies where the error occurred, if present.
461 },
462 ],
463 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
464 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
465 "message": "A String", # A human-readable description of the error.
466 "reason": "A String", # A short error code that summarizes the error.
467 "location": "A String", # Specifies where the error occurred, if present.
468 },
469 },
470 "kind": "bigquery#job", # [Output-only] The type of the resource.
471 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
472 "load": { # [Output-only] Statistics for a load job.
473 "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.
474 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700475 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a load job.
476 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
John Asmuth614db982014-04-24 15:46:26 -0400477 },
478 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
479 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
480 "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.
481 "query": { # [Output-only] Statistics for a query job.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400482 "queryPlan": [ # [Output-only, Experimental] Describes execution plan for the query.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800483 {
484 "computeRatioMax": 3.14, # Relative amount of time the slowest shard spent on CPU-bound tasks.
485 "recordsWritten": "A String", # Number of records written by the stage.
486 "waitRatioMax": 3.14, # Relative amount of time the slowest shard spent waiting to be scheduled.
487 "readRatioAvg": 3.14, # Relative amount of time the average shard spent reading input.
488 "readRatioMax": 3.14, # Relative amount of time the slowest shard spent reading input.
489 "steps": [ # List of operations within the stage in dependency order (approximately chronological).
490 {
491 "kind": "A String", # Machine-readable operation type.
492 "substeps": [ # Human-readable stage descriptions.
493 "A String",
494 ],
495 },
496 ],
497 "recordsRead": "A String", # Number of records read into the stage.
498 "computeRatioAvg": 3.14, # Relative amount of time the average shard spent on CPU-bound tasks.
499 "writeRatioMax": 3.14, # Relative amount of time the slowest shard spent on writing output.
500 "writeRatioAvg": 3.14, # Relative amount of time the average shard spent on writing output.
501 "waitRatioAvg": 3.14, # Relative amount of time the average shard spent waiting to be scheduled.
502 "id": "A String", # Unique ID for stage within plan.
503 "name": "A String", # Human-readable name for stage.
504 },
505 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800506 "statementType": "A String", # [Output-only, Experimental] The type of query statement, if valid.
Takashi Matsuo06694102015-09-11 13:55:40 -0700507 "totalBytesBilled": "A String", # [Output-only] Total bytes billed for the job.
508 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for the job.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800509 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700510 "undeclaredQueryParameters": [ # [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.
511 {
512 "parameterType": { # [Required] The type of this parameter.
513 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
514 {
515 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
516 "description": "A String", # [Optional] Human-oriented description of the field.
517 "name": "A String", # [Optional] The name of this field.
518 },
519 ],
520 "type": "A String", # [Required] The top level type of this field.
521 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
522 },
523 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700524 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
525 "a_key": # Object with schema name: QueryParameterValue
526 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700527 "arrayValues": [ # [Optional] The array values, if this is an array type.
528 # Object with schema name: QueryParameterValue
529 ],
530 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
531 },
532 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
533 },
534 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400535 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800536 "billingTier": 42, # [Output-only] Billing tier for the job.
537 "referencedTables": [ # [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
538 {
539 "projectId": "A String", # [Required] The ID of the project containing this table.
540 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
541 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
542 },
543 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700544 "schema": { # [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
545 "fields": [ # Describes the fields in a table.
546 {
547 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
548 # Object with schema name: TableFieldSchema
549 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800550 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700551 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
552 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
553 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
554 },
555 ],
556 },
John Asmuth614db982014-04-24 15:46:26 -0400557 },
558 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800559 "extract": { # [Output-only] Statistics for an extract job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700560 "destinationUriFileCounts": [ # [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
Craig Citroe633be12015-03-02 13:40:36 -0800561 "A String",
562 ],
563 },
John Asmuth614db982014-04-24 15:46:26 -0400564 },
565 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
Craig Citroe633be12015-03-02 13:40:36 -0800566 "projectId": "A String", # [Required] The ID of the project containing this job.
567 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -0400568 },
569 "etag": "A String", # [Output-only] A hash of this resource.
Craig Citroe633be12015-03-02 13:40:36 -0800570 "user_email": "A String", # [Output-only] Email address of the user who ran the job.
John Asmuth614db982014-04-24 15:46:26 -0400571 "configuration": { # [Required] Describes the job configuration.
572 "load": { # [Pick one] Configures a load job.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800573 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
574 "A String",
575 ],
John Asmuth614db982014-04-24 15:46:26 -0400576 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800577 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. 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 (',').
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400578 "autodetect": True or False, # [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800579 "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". For Avro, specify "AVRO". The default value is CSV.
John Asmuth614db982014-04-24 15:46:26 -0400580 "destinationTable": { # [Required] The destination table to load the data into.
Craig Citroe633be12015-03-02 13:40:36 -0800581 "projectId": "A String", # [Required] The ID of the project containing this table.
582 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
583 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400584 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000585 "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_APPEND. 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.
586 "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. The default value is 0, which requires that all records are valid.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400587 "nullMarker": "A String", # [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000588 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
John Asmuth614db982014-04-24 15:46:26 -0400589 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000590 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
John Asmuth614db982014-04-24 15:46:26 -0400591 "A String",
592 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000593 "quote": """, # [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.
John Asmuth614db982014-04-24 15:46:26 -0400594 "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.
595 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
596 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
597 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400598 "projectionFields": [ # [Experimental] If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
Craig Citroe633be12015-03-02 13:40:36 -0800599 "A String",
600 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000601 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800602 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
John Asmuth614db982014-04-24 15:46:26 -0400603 "fields": [ # Describes the fields in a table.
604 {
605 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
606 # Object with schema name: TableFieldSchema
607 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800608 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -0800609 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
610 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -0400611 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
612 },
613 ],
614 },
615 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800616 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400617 "labels": { # [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700618 "a_key": "A String",
619 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800620 "query": { # [Pick one] Configures a query job.
621 "flattenResults": true, # [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.
622 "maximumBillingTier": 1, # [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
623 "useQueryCache": true, # [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. The default value is true.
624 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
625 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
626 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
627 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800628 "useLegacySql": True or False, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800629 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800630 "projectId": "A String", # [Required] The ID of the project containing this table.
631 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
632 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400633 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700634 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700635 "A String",
636 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800637 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
638 "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.
639 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400640 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700641 {
642 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
643 "inlineCode": "A String", # [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
644 },
645 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700646 "queryParameters": [ # Query parameters for standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700647 {
648 "parameterType": { # [Required] The type of this parameter.
649 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
650 {
651 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
652 "description": "A String", # [Optional] Human-oriented description of the field.
653 "name": "A String", # [Optional] The name of this field.
654 },
655 ],
656 "type": "A String", # [Required] The top level type of this field.
657 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
658 },
659 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700660 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
661 "a_key": # Object with schema name: QueryParameterValue
662 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700663 "arrayValues": [ # [Optional] The array values, if this is an array type.
664 # Object with schema name: QueryParameterValue
665 ],
666 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
667 },
668 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
669 },
670 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800671 "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.
672 "query": "A String", # [Required] BigQuery SQL query to execute.
673 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700674 "maximumBytesBilled": "A String", # [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800675 "tableDefinitions": { # [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
676 "a_key": {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700677 "compression": "A String", # [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800678 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
679 "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 (',').
680 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700681 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800682 "allowJaggedRows": True or False, # [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
683 "quote": """, # [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 "allowQuotedNewlines": True or False, # [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
685 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400686 "autodetect": True or False, # [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700687 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
688 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
689 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800690 "A String",
691 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700692 "bigtableOptions": { # [Optional] Additional options if sourceFormat is set to BIGTABLE.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700693 "readRowkeyAsString": True or False, # [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700694 "ignoreUnspecifiedColumnFamilies": True or False, # [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
695 "columnFamilies": [ # [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
696 {
697 "familyId": "A String", # Identifier of the column family.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700698 "type": "A String", # [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700699 "onlyReadLatest": True or False, # [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
700 "columns": [ # [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
701 {
702 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
703 "qualifierEncoded": "A String", # [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
704 "fieldName": "A String", # [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
705 "onlyReadLatest": True or False, # [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
706 "qualifierString": "A String",
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700707 "type": "A String", # [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700708 },
709 ],
710 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
711 },
712 ],
713 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400714 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700715 "googleSheetsOptions": { # [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
716 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
717 },
718 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800719 "fields": [ # Describes the fields in a table.
720 {
721 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
722 # Object with schema name: TableFieldSchema
723 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800724 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800725 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
726 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
727 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
728 },
729 ],
730 },
731 },
732 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400733 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
John Asmuth614db982014-04-24 15:46:26 -0400734 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700735 "copy": { # [Pick one] Copies a table.
736 "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.
737 "sourceTables": [ # [Pick one] Source tables to copy.
738 {
739 "projectId": "A String", # [Required] The ID of the project containing this table.
740 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
741 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
742 },
743 ],
744 "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.
745 "destinationTable": { # [Required] The destination table
746 "projectId": "A String", # [Required] The ID of the project containing this table.
747 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
748 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
749 },
750 "sourceTable": { # [Pick one] Source table to copy.
751 "projectId": "A String", # [Required] The ID of the project containing this table.
752 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
753 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
754 },
755 },
756 "extract": { # [Pick one] Configures an extract job.
757 "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.
758 "compression": "A String", # [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE.
759 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
760 "destinationFormat": "A String", # [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV.
761 "printHeader": true, # [Optional] Whether to print out a header row in the results. Default is true.
762 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
763 "A String",
764 ],
765 "sourceTable": { # [Required] A reference to the table being exported.
766 "projectId": "A String", # [Required] The ID of the project containing this table.
767 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
768 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
769 },
770 },
John Asmuth614db982014-04-24 15:46:26 -0400771 },
772 "id": "A String", # [Output-only] Opaque ID field of the job
773 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
774 }</pre>
775</div>
776
777<div class="method">
778 <code class="details" id="getQueryResults">getQueryResults(projectId, jobId, timeoutMs=None, pageToken=None, maxResults=None, startIndex=None)</code>
779 <pre>Retrieves the results of a query job.
780
781Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800782 projectId: string, [Required] Project ID of the query job (required)
783 jobId: string, [Required] Job ID of the query job (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700784 timeoutMs: integer, How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false
John Asmuth614db982014-04-24 15:46:26 -0400785 pageToken: string, Page token, returned by a previous call, to request the next page of results
786 maxResults: integer, Maximum number of results to read
787 startIndex: string, Zero-based index of the starting row
788
789Returns:
790 An object of the form:
791
792 {
793 "kind": "bigquery#getQueryResultsResponse", # The resource type of the response.
Takashi Matsuo06694102015-09-11 13:55:40 -0700794 "errors": [ # [Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000795 {
Takashi Matsuo06694102015-09-11 13:55:40 -0700796 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
797 "message": "A String", # A human-readable description of the error.
798 "reason": "A String", # A short error code that summarizes the error.
799 "location": "A String", # Specifies where the error occurred, if present.
John Asmuth614db982014-04-24 15:46:26 -0400800 },
801 ],
802 "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).
Craig Citroe633be12015-03-02 13:40:36 -0800803 "projectId": "A String", # [Required] The ID of the project containing this job.
804 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -0400805 },
806 "pageToken": "A String", # A token used for paging results.
807 "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.
808 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800809 "totalBytesProcessed": "A String", # The total number of bytes processed for this query.
John Asmuth614db982014-04-24 15:46:26 -0400810 "cacheHit": True or False, # Whether the query result was fetched from the query cache.
811 "etag": "A String", # A hash of this response.
Takashi Matsuo06694102015-09-11 13:55:40 -0700812 "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.
813 {
814 "f": [ # Represents a single row in the result set, consisting of one or more fields.
815 {
816 "v": "",
817 },
818 ],
819 },
820 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400821 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
John Asmuth614db982014-04-24 15:46:26 -0400822 "schema": { # The schema of the results. Present only when the query completes successfully.
823 "fields": [ # Describes the fields in a table.
824 {
825 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
826 # Object with schema name: TableFieldSchema
827 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800828 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -0800829 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
830 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -0400831 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
832 },
833 ],
834 },
835 }</pre>
836</div>
837
838<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400839 <code class="details" id="getQueryResults_next">getQueryResults_next(previous_request, previous_response)</code>
840 <pre>Retrieves the next page of results.
841
842Args:
843 previous_request: The request for the previous page. (required)
844 previous_response: The response from the request for the previous page. (required)
845
846Returns:
847 A request object that you can call 'execute()' on to request the next
848 page. Returns None if there are no more items in the collection.
849 </pre>
850</div>
851
852<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800853 <code class="details" id="insert">insert(projectId, body=None, media_body=None, media_mime_type=None)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000854 <pre>Starts a new asynchronous job. Requires the Can View project role.
John Asmuth614db982014-04-24 15:46:26 -0400855
856Args:
857 projectId: string, Project ID of the project that will be billed for the job (required)
858 body: object, The request body.
859 The object takes the form of:
860
861{
862 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
863 "state": "A String", # [Output-only] Running state of the job.
864 "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.
865 {
866 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
867 "message": "A String", # A human-readable description of the error.
868 "reason": "A String", # A short error code that summarizes the error.
869 "location": "A String", # Specifies where the error occurred, if present.
870 },
871 ],
872 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
873 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
874 "message": "A String", # A human-readable description of the error.
875 "reason": "A String", # A short error code that summarizes the error.
876 "location": "A String", # Specifies where the error occurred, if present.
877 },
878 },
879 "kind": "bigquery#job", # [Output-only] The type of the resource.
880 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
881 "load": { # [Output-only] Statistics for a load job.
882 "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.
883 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700884 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a load job.
885 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
John Asmuth614db982014-04-24 15:46:26 -0400886 },
887 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
888 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
889 "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.
890 "query": { # [Output-only] Statistics for a query job.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400891 "queryPlan": [ # [Output-only, Experimental] Describes execution plan for the query.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800892 {
893 "computeRatioMax": 3.14, # Relative amount of time the slowest shard spent on CPU-bound tasks.
894 "recordsWritten": "A String", # Number of records written by the stage.
895 "waitRatioMax": 3.14, # Relative amount of time the slowest shard spent waiting to be scheduled.
896 "readRatioAvg": 3.14, # Relative amount of time the average shard spent reading input.
897 "readRatioMax": 3.14, # Relative amount of time the slowest shard spent reading input.
898 "steps": [ # List of operations within the stage in dependency order (approximately chronological).
899 {
900 "kind": "A String", # Machine-readable operation type.
901 "substeps": [ # Human-readable stage descriptions.
902 "A String",
903 ],
904 },
905 ],
906 "recordsRead": "A String", # Number of records read into the stage.
907 "computeRatioAvg": 3.14, # Relative amount of time the average shard spent on CPU-bound tasks.
908 "writeRatioMax": 3.14, # Relative amount of time the slowest shard spent on writing output.
909 "writeRatioAvg": 3.14, # Relative amount of time the average shard spent on writing output.
910 "waitRatioAvg": 3.14, # Relative amount of time the average shard spent waiting to be scheduled.
911 "id": "A String", # Unique ID for stage within plan.
912 "name": "A String", # Human-readable name for stage.
913 },
914 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800915 "statementType": "A String", # [Output-only, Experimental] The type of query statement, if valid.
Takashi Matsuo06694102015-09-11 13:55:40 -0700916 "totalBytesBilled": "A String", # [Output-only] Total bytes billed for the job.
917 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for the job.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800918 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700919 "undeclaredQueryParameters": [ # [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.
920 {
921 "parameterType": { # [Required] The type of this parameter.
922 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
923 {
924 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
925 "description": "A String", # [Optional] Human-oriented description of the field.
926 "name": "A String", # [Optional] The name of this field.
927 },
928 ],
929 "type": "A String", # [Required] The top level type of this field.
930 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
931 },
932 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700933 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
934 "a_key": # Object with schema name: QueryParameterValue
935 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -0700936 "arrayValues": [ # [Optional] The array values, if this is an array type.
937 # Object with schema name: QueryParameterValue
938 ],
939 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
940 },
941 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
942 },
943 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400944 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800945 "billingTier": 42, # [Output-only] Billing tier for the job.
946 "referencedTables": [ # [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
947 {
948 "projectId": "A String", # [Required] The ID of the project containing this table.
949 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
950 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
951 },
952 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700953 "schema": { # [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
954 "fields": [ # Describes the fields in a table.
955 {
956 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
957 # Object with schema name: TableFieldSchema
958 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800959 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700960 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
961 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
962 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
963 },
964 ],
965 },
John Asmuth614db982014-04-24 15:46:26 -0400966 },
967 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800968 "extract": { # [Output-only] Statistics for an extract job.
Takashi Matsuo06694102015-09-11 13:55:40 -0700969 "destinationUriFileCounts": [ # [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
Craig Citroe633be12015-03-02 13:40:36 -0800970 "A String",
971 ],
972 },
John Asmuth614db982014-04-24 15:46:26 -0400973 },
974 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
Craig Citroe633be12015-03-02 13:40:36 -0800975 "projectId": "A String", # [Required] The ID of the project containing this job.
976 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -0400977 },
978 "etag": "A String", # [Output-only] A hash of this resource.
Craig Citroe633be12015-03-02 13:40:36 -0800979 "user_email": "A String", # [Output-only] Email address of the user who ran the job.
John Asmuth614db982014-04-24 15:46:26 -0400980 "configuration": { # [Required] Describes the job configuration.
981 "load": { # [Pick one] Configures a load job.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800982 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
983 "A String",
984 ],
John Asmuth614db982014-04-24 15:46:26 -0400985 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800986 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. 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 (',').
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400987 "autodetect": True or False, # [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800988 "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". For Avro, specify "AVRO". The default value is CSV.
John Asmuth614db982014-04-24 15:46:26 -0400989 "destinationTable": { # [Required] The destination table to load the data into.
Craig Citroe633be12015-03-02 13:40:36 -0800990 "projectId": "A String", # [Required] The ID of the project containing this table.
991 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
992 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400993 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000994 "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_APPEND. 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.
995 "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. The default value is 0, which requires that all records are valid.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400996 "nullMarker": "A String", # [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000997 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
John Asmuth614db982014-04-24 15:46:26 -0400998 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000999 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
John Asmuth614db982014-04-24 15:46:26 -04001000 "A String",
1001 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001002 "quote": """, # [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.
John Asmuth614db982014-04-24 15:46:26 -04001003 "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.
1004 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
1005 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
1006 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001007 "projectionFields": [ # [Experimental] If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
Craig Citroe633be12015-03-02 13:40:36 -08001008 "A String",
1009 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001010 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001011 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
John Asmuth614db982014-04-24 15:46:26 -04001012 "fields": [ # Describes the fields in a table.
1013 {
1014 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1015 # Object with schema name: TableFieldSchema
1016 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001017 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -08001018 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1019 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -04001020 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1021 },
1022 ],
1023 },
1024 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001025 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001026 "labels": { # [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001027 "a_key": "A String",
1028 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001029 "query": { # [Pick one] Configures a query job.
1030 "flattenResults": true, # [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.
1031 "maximumBillingTier": 1, # [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
1032 "useQueryCache": true, # [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. The default value is true.
1033 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
1034 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
1035 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1036 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001037 "useLegacySql": True or False, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001038 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001039 "projectId": "A String", # [Required] The ID of the project containing this table.
1040 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1041 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -04001042 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001043 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001044 "A String",
1045 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001046 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
1047 "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.
1048 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001049 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001050 {
1051 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
1052 "inlineCode": "A String", # [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
1053 },
1054 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001055 "queryParameters": [ # Query parameters for standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001056 {
1057 "parameterType": { # [Required] The type of this parameter.
1058 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1059 {
1060 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1061 "description": "A String", # [Optional] Human-oriented description of the field.
1062 "name": "A String", # [Optional] The name of this field.
1063 },
1064 ],
1065 "type": "A String", # [Required] The top level type of this field.
1066 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1067 },
1068 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001069 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1070 "a_key": # Object with schema name: QueryParameterValue
1071 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001072 "arrayValues": [ # [Optional] The array values, if this is an array type.
1073 # Object with schema name: QueryParameterValue
1074 ],
1075 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1076 },
1077 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1078 },
1079 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001080 "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.
1081 "query": "A String", # [Required] BigQuery SQL query to execute.
1082 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001083 "maximumBytesBilled": "A String", # [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001084 "tableDefinitions": { # [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
1085 "a_key": {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001086 "compression": "A String", # [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001087 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
1088 "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 (',').
1089 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001090 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001091 "allowJaggedRows": True or False, # [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
1092 "quote": """, # [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.
1093 "allowQuotedNewlines": True or False, # [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
1094 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001095 "autodetect": True or False, # [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001096 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
1097 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
1098 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001099 "A String",
1100 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001101 "bigtableOptions": { # [Optional] Additional options if sourceFormat is set to BIGTABLE.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001102 "readRowkeyAsString": True or False, # [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001103 "ignoreUnspecifiedColumnFamilies": True or False, # [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
1104 "columnFamilies": [ # [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
1105 {
1106 "familyId": "A String", # Identifier of the column family.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001107 "type": "A String", # [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001108 "onlyReadLatest": True or False, # [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
1109 "columns": [ # [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
1110 {
1111 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
1112 "qualifierEncoded": "A String", # [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
1113 "fieldName": "A String", # [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
1114 "onlyReadLatest": True or False, # [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
1115 "qualifierString": "A String",
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001116 "type": "A String", # [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001117 },
1118 ],
1119 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
1120 },
1121 ],
1122 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001123 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001124 "googleSheetsOptions": { # [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
1125 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
1126 },
1127 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001128 "fields": [ # Describes the fields in a table.
1129 {
1130 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1131 # Object with schema name: TableFieldSchema
1132 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001133 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001134 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1135 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
1136 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1137 },
1138 ],
1139 },
1140 },
1141 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001142 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
John Asmuth614db982014-04-24 15:46:26 -04001143 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001144 "copy": { # [Pick one] Copies a table.
1145 "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.
1146 "sourceTables": [ # [Pick one] Source tables to copy.
1147 {
1148 "projectId": "A String", # [Required] The ID of the project containing this table.
1149 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1150 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1151 },
1152 ],
1153 "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.
1154 "destinationTable": { # [Required] The destination table
1155 "projectId": "A String", # [Required] The ID of the project containing this table.
1156 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1157 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1158 },
1159 "sourceTable": { # [Pick one] Source table to copy.
1160 "projectId": "A String", # [Required] The ID of the project containing this table.
1161 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1162 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1163 },
1164 },
1165 "extract": { # [Pick one] Configures an extract job.
1166 "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.
1167 "compression": "A String", # [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE.
1168 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
1169 "destinationFormat": "A String", # [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV.
1170 "printHeader": true, # [Optional] Whether to print out a header row in the results. Default is true.
1171 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
1172 "A String",
1173 ],
1174 "sourceTable": { # [Required] A reference to the table being exported.
1175 "projectId": "A String", # [Required] The ID of the project containing this table.
1176 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1177 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1178 },
1179 },
John Asmuth614db982014-04-24 15:46:26 -04001180 },
1181 "id": "A String", # [Output-only] Opaque ID field of the job
1182 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
1183 }
1184
1185 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001186 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
John Asmuth614db982014-04-24 15:46:26 -04001187
1188Returns:
1189 An object of the form:
1190
1191 {
1192 "status": { # [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
1193 "state": "A String", # [Output-only] Running state of the job.
1194 "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.
1195 {
1196 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1197 "message": "A String", # A human-readable description of the error.
1198 "reason": "A String", # A short error code that summarizes the error.
1199 "location": "A String", # Specifies where the error occurred, if present.
1200 },
1201 ],
1202 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
1203 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1204 "message": "A String", # A human-readable description of the error.
1205 "reason": "A String", # A short error code that summarizes the error.
1206 "location": "A String", # Specifies where the error occurred, if present.
1207 },
1208 },
1209 "kind": "bigquery#job", # [Output-only] The type of the resource.
1210 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
1211 "load": { # [Output-only] Statistics for a load job.
1212 "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.
1213 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
Takashi Matsuo06694102015-09-11 13:55:40 -07001214 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a load job.
1215 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
John Asmuth614db982014-04-24 15:46:26 -04001216 },
1217 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
1218 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
1219 "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.
1220 "query": { # [Output-only] Statistics for a query job.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001221 "queryPlan": [ # [Output-only, Experimental] Describes execution plan for the query.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001222 {
1223 "computeRatioMax": 3.14, # Relative amount of time the slowest shard spent on CPU-bound tasks.
1224 "recordsWritten": "A String", # Number of records written by the stage.
1225 "waitRatioMax": 3.14, # Relative amount of time the slowest shard spent waiting to be scheduled.
1226 "readRatioAvg": 3.14, # Relative amount of time the average shard spent reading input.
1227 "readRatioMax": 3.14, # Relative amount of time the slowest shard spent reading input.
1228 "steps": [ # List of operations within the stage in dependency order (approximately chronological).
1229 {
1230 "kind": "A String", # Machine-readable operation type.
1231 "substeps": [ # Human-readable stage descriptions.
1232 "A String",
1233 ],
1234 },
1235 ],
1236 "recordsRead": "A String", # Number of records read into the stage.
1237 "computeRatioAvg": 3.14, # Relative amount of time the average shard spent on CPU-bound tasks.
1238 "writeRatioMax": 3.14, # Relative amount of time the slowest shard spent on writing output.
1239 "writeRatioAvg": 3.14, # Relative amount of time the average shard spent on writing output.
1240 "waitRatioAvg": 3.14, # Relative amount of time the average shard spent waiting to be scheduled.
1241 "id": "A String", # Unique ID for stage within plan.
1242 "name": "A String", # Human-readable name for stage.
1243 },
1244 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001245 "statementType": "A String", # [Output-only, Experimental] The type of query statement, if valid.
Takashi Matsuo06694102015-09-11 13:55:40 -07001246 "totalBytesBilled": "A String", # [Output-only] Total bytes billed for the job.
1247 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for the job.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001248 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001249 "undeclaredQueryParameters": [ # [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.
1250 {
1251 "parameterType": { # [Required] The type of this parameter.
1252 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1253 {
1254 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1255 "description": "A String", # [Optional] Human-oriented description of the field.
1256 "name": "A String", # [Optional] The name of this field.
1257 },
1258 ],
1259 "type": "A String", # [Required] The top level type of this field.
1260 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1261 },
1262 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001263 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1264 "a_key": # Object with schema name: QueryParameterValue
1265 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001266 "arrayValues": [ # [Optional] The array values, if this is an array type.
1267 # Object with schema name: QueryParameterValue
1268 ],
1269 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1270 },
1271 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1272 },
1273 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001274 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001275 "billingTier": 42, # [Output-only] Billing tier for the job.
1276 "referencedTables": [ # [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
1277 {
1278 "projectId": "A String", # [Required] The ID of the project containing this table.
1279 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1280 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1281 },
1282 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001283 "schema": { # [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
1284 "fields": [ # Describes the fields in a table.
1285 {
1286 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1287 # Object with schema name: TableFieldSchema
1288 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001289 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001290 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1291 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
1292 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1293 },
1294 ],
1295 },
John Asmuth614db982014-04-24 15:46:26 -04001296 },
1297 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001298 "extract": { # [Output-only] Statistics for an extract job.
Takashi Matsuo06694102015-09-11 13:55:40 -07001299 "destinationUriFileCounts": [ # [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
Craig Citroe633be12015-03-02 13:40:36 -08001300 "A String",
1301 ],
1302 },
John Asmuth614db982014-04-24 15:46:26 -04001303 },
1304 "jobReference": { # [Optional] Reference describing the unique-per-user name of the job.
Craig Citroe633be12015-03-02 13:40:36 -08001305 "projectId": "A String", # [Required] The ID of the project containing this job.
1306 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -04001307 },
1308 "etag": "A String", # [Output-only] A hash of this resource.
Craig Citroe633be12015-03-02 13:40:36 -08001309 "user_email": "A String", # [Output-only] Email address of the user who ran the job.
John Asmuth614db982014-04-24 15:46:26 -04001310 "configuration": { # [Required] Describes the job configuration.
1311 "load": { # [Pick one] Configures a load job.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001312 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
1313 "A String",
1314 ],
John Asmuth614db982014-04-24 15:46:26 -04001315 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001316 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. 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 (',').
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001317 "autodetect": True or False, # [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001318 "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". For Avro, specify "AVRO". The default value is CSV.
John Asmuth614db982014-04-24 15:46:26 -04001319 "destinationTable": { # [Required] The destination table to load the data into.
Craig Citroe633be12015-03-02 13:40:36 -08001320 "projectId": "A String", # [Required] The ID of the project containing this table.
1321 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1322 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -04001323 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001324 "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_APPEND. 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.
1325 "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. The default value is 0, which requires that all records are valid.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001326 "nullMarker": "A String", # [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001327 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
John Asmuth614db982014-04-24 15:46:26 -04001328 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001329 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
John Asmuth614db982014-04-24 15:46:26 -04001330 "A String",
1331 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001332 "quote": """, # [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.
John Asmuth614db982014-04-24 15:46:26 -04001333 "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.
1334 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
1335 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
1336 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001337 "projectionFields": [ # [Experimental] If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
Craig Citroe633be12015-03-02 13:40:36 -08001338 "A String",
1339 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001340 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001341 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
John Asmuth614db982014-04-24 15:46:26 -04001342 "fields": [ # Describes the fields in a table.
1343 {
1344 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1345 # Object with schema name: TableFieldSchema
1346 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001347 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -08001348 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1349 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -04001350 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1351 },
1352 ],
1353 },
1354 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001355 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001356 "labels": { # [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001357 "a_key": "A String",
1358 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001359 "query": { # [Pick one] Configures a query job.
1360 "flattenResults": true, # [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.
1361 "maximumBillingTier": 1, # [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
1362 "useQueryCache": true, # [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. The default value is true.
1363 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
1364 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
1365 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1366 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001367 "useLegacySql": True or False, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001368 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001369 "projectId": "A String", # [Required] The ID of the project containing this table.
1370 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1371 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -04001372 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001373 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001374 "A String",
1375 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001376 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
1377 "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.
1378 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001379 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001380 {
1381 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
1382 "inlineCode": "A String", # [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
1383 },
1384 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001385 "queryParameters": [ # Query parameters for standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001386 {
1387 "parameterType": { # [Required] The type of this parameter.
1388 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1389 {
1390 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1391 "description": "A String", # [Optional] Human-oriented description of the field.
1392 "name": "A String", # [Optional] The name of this field.
1393 },
1394 ],
1395 "type": "A String", # [Required] The top level type of this field.
1396 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1397 },
1398 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001399 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1400 "a_key": # Object with schema name: QueryParameterValue
1401 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001402 "arrayValues": [ # [Optional] The array values, if this is an array type.
1403 # Object with schema name: QueryParameterValue
1404 ],
1405 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1406 },
1407 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1408 },
1409 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001410 "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.
1411 "query": "A String", # [Required] BigQuery SQL query to execute.
1412 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001413 "maximumBytesBilled": "A String", # [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001414 "tableDefinitions": { # [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
1415 "a_key": {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001416 "compression": "A String", # [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001417 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
1418 "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 (',').
1419 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001420 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001421 "allowJaggedRows": True or False, # [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
1422 "quote": """, # [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.
1423 "allowQuotedNewlines": True or False, # [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
1424 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001425 "autodetect": True or False, # [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001426 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
1427 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
1428 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001429 "A String",
1430 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001431 "bigtableOptions": { # [Optional] Additional options if sourceFormat is set to BIGTABLE.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001432 "readRowkeyAsString": True or False, # [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001433 "ignoreUnspecifiedColumnFamilies": True or False, # [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
1434 "columnFamilies": [ # [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
1435 {
1436 "familyId": "A String", # Identifier of the column family.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001437 "type": "A String", # [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001438 "onlyReadLatest": True or False, # [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
1439 "columns": [ # [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
1440 {
1441 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
1442 "qualifierEncoded": "A String", # [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
1443 "fieldName": "A String", # [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
1444 "onlyReadLatest": True or False, # [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
1445 "qualifierString": "A String",
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001446 "type": "A String", # [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001447 },
1448 ],
1449 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
1450 },
1451 ],
1452 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001453 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001454 "googleSheetsOptions": { # [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
1455 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
1456 },
1457 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001458 "fields": [ # Describes the fields in a table.
1459 {
1460 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1461 # Object with schema name: TableFieldSchema
1462 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001463 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001464 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1465 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
1466 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1467 },
1468 ],
1469 },
1470 },
1471 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001472 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
John Asmuth614db982014-04-24 15:46:26 -04001473 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001474 "copy": { # [Pick one] Copies a table.
1475 "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.
1476 "sourceTables": [ # [Pick one] Source tables to copy.
1477 {
1478 "projectId": "A String", # [Required] The ID of the project containing this table.
1479 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1480 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1481 },
1482 ],
1483 "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.
1484 "destinationTable": { # [Required] The destination table
1485 "projectId": "A String", # [Required] The ID of the project containing this table.
1486 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1487 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1488 },
1489 "sourceTable": { # [Pick one] Source table to copy.
1490 "projectId": "A String", # [Required] The ID of the project containing this table.
1491 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1492 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1493 },
1494 },
1495 "extract": { # [Pick one] Configures an extract job.
1496 "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.
1497 "compression": "A String", # [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE.
1498 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
1499 "destinationFormat": "A String", # [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV.
1500 "printHeader": true, # [Optional] Whether to print out a header row in the results. Default is true.
1501 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
1502 "A String",
1503 ],
1504 "sourceTable": { # [Required] A reference to the table being exported.
1505 "projectId": "A String", # [Required] The ID of the project containing this table.
1506 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1507 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1508 },
1509 },
John Asmuth614db982014-04-24 15:46:26 -04001510 },
1511 "id": "A String", # [Output-only] Opaque ID field of the job
1512 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
1513 }</pre>
1514</div>
1515
1516<div class="method">
1517 <code class="details" id="list">list(projectId, projection=None, stateFilter=None, pageToken=None, allUsers=None, maxResults=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -07001518 <pre>Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
John Asmuth614db982014-04-24 15:46:26 -04001519
1520Args:
1521 projectId: string, Project ID of the jobs to list (required)
1522 projection: string, Restrict information returned to a set of selected fields
1523 Allowed values
1524 full - Includes all job data
1525 minimal - Does not include the job configuration
1526 stateFilter: string, Filter for job state (repeated)
1527 Allowed values
1528 done - Finished jobs
1529 pending - Pending jobs
1530 running - Running jobs
1531 pageToken: string, Page token, returned by a previous call, to request the next page of results
1532 allUsers: boolean, Whether to display jobs owned by all users in the project. Default false
1533 maxResults: integer, Maximum number of results to return
1534
1535Returns:
1536 An object of the form:
1537
1538 {
1539 "nextPageToken": "A String", # A token to request the next page of results.
John Asmuth614db982014-04-24 15:46:26 -04001540 "kind": "bigquery#jobList", # The resource type of the response.
1541 "etag": "A String", # A hash of this page of results.
1542 "jobs": [ # List of jobs that were requested.
1543 {
1544 "status": { # [Full-projection-only] Describes the state of the job.
1545 "state": "A String", # [Output-only] Running state of the job.
1546 "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.
1547 {
1548 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1549 "message": "A String", # A human-readable description of the error.
1550 "reason": "A String", # A short error code that summarizes the error.
1551 "location": "A String", # Specifies where the error occurred, if present.
1552 },
1553 ],
1554 "errorResult": { # [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
1555 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1556 "message": "A String", # A human-readable description of the error.
1557 "reason": "A String", # A short error code that summarizes the error.
1558 "location": "A String", # Specifies where the error occurred, if present.
1559 },
1560 },
1561 "kind": "bigquery#job", # The resource type.
1562 "statistics": { # [Output-only] Information about the job, including starting time and ending time of the job.
1563 "load": { # [Output-only] Statistics for a load job.
1564 "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.
1565 "inputFiles": "A String", # [Output-only] Number of source files in a load job.
Takashi Matsuo06694102015-09-11 13:55:40 -07001566 "inputFileBytes": "A String", # [Output-only] Number of bytes of source data in a load job.
1567 "outputBytes": "A String", # [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
John Asmuth614db982014-04-24 15:46:26 -04001568 },
1569 "creationTime": "A String", # [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
1570 "totalBytesProcessed": "A String", # [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
1571 "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.
1572 "query": { # [Output-only] Statistics for a query job.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001573 "queryPlan": [ # [Output-only, Experimental] Describes execution plan for the query.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001574 {
1575 "computeRatioMax": 3.14, # Relative amount of time the slowest shard spent on CPU-bound tasks.
1576 "recordsWritten": "A String", # Number of records written by the stage.
1577 "waitRatioMax": 3.14, # Relative amount of time the slowest shard spent waiting to be scheduled.
1578 "readRatioAvg": 3.14, # Relative amount of time the average shard spent reading input.
1579 "readRatioMax": 3.14, # Relative amount of time the slowest shard spent reading input.
1580 "steps": [ # List of operations within the stage in dependency order (approximately chronological).
1581 {
1582 "kind": "A String", # Machine-readable operation type.
1583 "substeps": [ # Human-readable stage descriptions.
1584 "A String",
1585 ],
1586 },
1587 ],
1588 "recordsRead": "A String", # Number of records read into the stage.
1589 "computeRatioAvg": 3.14, # Relative amount of time the average shard spent on CPU-bound tasks.
1590 "writeRatioMax": 3.14, # Relative amount of time the slowest shard spent on writing output.
1591 "writeRatioAvg": 3.14, # Relative amount of time the average shard spent on writing output.
1592 "waitRatioAvg": 3.14, # Relative amount of time the average shard spent waiting to be scheduled.
1593 "id": "A String", # Unique ID for stage within plan.
1594 "name": "A String", # Human-readable name for stage.
1595 },
1596 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001597 "statementType": "A String", # [Output-only, Experimental] The type of query statement, if valid.
Takashi Matsuo06694102015-09-11 13:55:40 -07001598 "totalBytesBilled": "A String", # [Output-only] Total bytes billed for the job.
1599 "totalBytesProcessed": "A String", # [Output-only] Total bytes processed for the job.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001600 "cacheHit": True or False, # [Output-only] Whether the query result was fetched from the query cache.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001601 "undeclaredQueryParameters": [ # [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation.
1602 {
1603 "parameterType": { # [Required] The type of this parameter.
1604 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1605 {
1606 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1607 "description": "A String", # [Optional] Human-oriented description of the field.
1608 "name": "A String", # [Optional] The name of this field.
1609 },
1610 ],
1611 "type": "A String", # [Required] The top level type of this field.
1612 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1613 },
1614 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001615 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1616 "a_key": # Object with schema name: QueryParameterValue
1617 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001618 "arrayValues": [ # [Optional] The array values, if this is an array type.
1619 # Object with schema name: QueryParameterValue
1620 ],
1621 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1622 },
1623 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1624 },
1625 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001626 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001627 "billingTier": 42, # [Output-only] Billing tier for the job.
1628 "referencedTables": [ # [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
1629 {
1630 "projectId": "A String", # [Required] The ID of the project containing this table.
1631 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1632 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1633 },
1634 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001635 "schema": { # [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
1636 "fields": [ # Describes the fields in a table.
1637 {
1638 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1639 # Object with schema name: TableFieldSchema
1640 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001641 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001642 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1643 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
1644 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1645 },
1646 ],
1647 },
John Asmuth614db982014-04-24 15:46:26 -04001648 },
1649 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001650 "extract": { # [Output-only] Statistics for an extract job.
Takashi Matsuo06694102015-09-11 13:55:40 -07001651 "destinationUriFileCounts": [ # [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
Craig Citroe633be12015-03-02 13:40:36 -08001652 "A String",
1653 ],
1654 },
John Asmuth614db982014-04-24 15:46:26 -04001655 },
1656 "jobReference": { # Job reference uniquely identifying the job.
Craig Citroe633be12015-03-02 13:40:36 -08001657 "projectId": "A String", # [Required] The ID of the project containing this job.
1658 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -04001659 },
1660 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001661 "user_email": "A String", # [Full-projection-only] Email address of the user who ran the job.
John Asmuth614db982014-04-24 15:46:26 -04001662 "configuration": { # [Full-projection-only] Specifies the job configuration.
1663 "load": { # [Pick one] Configures a load job.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001664 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
1665 "A String",
1666 ],
John Asmuth614db982014-04-24 15:46:26 -04001667 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001668 "fieldDelimiter": "A String", # [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. 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 (',').
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001669 "autodetect": True or False, # [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001670 "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". For Avro, specify "AVRO". The default value is CSV.
John Asmuth614db982014-04-24 15:46:26 -04001671 "destinationTable": { # [Required] The destination table to load the data into.
Craig Citroe633be12015-03-02 13:40:36 -08001672 "projectId": "A String", # [Required] The ID of the project containing this table.
1673 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1674 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -04001675 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001676 "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_APPEND. 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.
1677 "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. The default value is 0, which requires that all records are valid.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001678 "nullMarker": "A String", # [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001679 "allowJaggedRows": True or False, # [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
John Asmuth614db982014-04-24 15:46:26 -04001680 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001681 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
John Asmuth614db982014-04-24 15:46:26 -04001682 "A String",
1683 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001684 "quote": """, # [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.
John Asmuth614db982014-04-24 15:46:26 -04001685 "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.
1686 "schemaInlineFormat": "A String", # [Deprecated] The format of the schemaInline property.
1687 "schemaInline": "A String", # [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
1688 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001689 "projectionFields": [ # [Experimental] If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
Craig Citroe633be12015-03-02 13:40:36 -08001690 "A String",
1691 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001692 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001693 "schema": { # [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
John Asmuth614db982014-04-24 15:46:26 -04001694 "fields": [ # Describes the fields in a table.
1695 {
1696 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1697 # Object with schema name: TableFieldSchema
1698 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001699 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -08001700 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1701 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -04001702 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1703 },
1704 ],
1705 },
1706 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001707 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001708 "labels": { # [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001709 "a_key": "A String",
1710 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001711 "query": { # [Pick one] Configures a query job.
1712 "flattenResults": true, # [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.
1713 "maximumBillingTier": 1, # [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
1714 "useQueryCache": true, # [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. The default value is true.
1715 "defaultDataset": { # [Optional] Specifies the default dataset to use for unqualified table names in the query.
1716 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
1717 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1718 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001719 "useLegacySql": True or False, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001720 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001721 "projectId": "A String", # [Required] The ID of the project containing this table.
1722 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1723 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -04001724 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001725 "schemaUpdateOptions": [ # [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001726 "A String",
1727 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001728 "priority": "A String", # [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
1729 "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.
1730 "allowLargeResults": True or False, # If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001731 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001732 {
1733 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
1734 "inlineCode": "A String", # [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
1735 },
1736 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001737 "queryParameters": [ # Query parameters for standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001738 {
1739 "parameterType": { # [Required] The type of this parameter.
1740 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1741 {
1742 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1743 "description": "A String", # [Optional] Human-oriented description of the field.
1744 "name": "A String", # [Optional] The name of this field.
1745 },
1746 ],
1747 "type": "A String", # [Required] The top level type of this field.
1748 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1749 },
1750 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001751 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1752 "a_key": # Object with schema name: QueryParameterValue
1753 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001754 "arrayValues": [ # [Optional] The array values, if this is an array type.
1755 # Object with schema name: QueryParameterValue
1756 ],
1757 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1758 },
1759 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1760 },
1761 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001762 "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.
1763 "query": "A String", # [Required] BigQuery SQL query to execute.
1764 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001765 "maximumBytesBilled": "A String", # [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001766 "tableDefinitions": { # [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
1767 "a_key": {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001768 "compression": "A String", # [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001769 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
1770 "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 (',').
1771 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001772 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001773 "allowJaggedRows": True or False, # [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
1774 "quote": """, # [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.
1775 "allowQuotedNewlines": True or False, # [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
1776 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001777 "autodetect": True or False, # [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001778 "maxBadRecords": 42, # [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
1779 "ignoreUnknownValues": True or False, # [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
1780 "sourceUris": [ # [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified, and it must end with '.backup_info'. Also, the '*' wildcard character is not allowed.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001781 "A String",
1782 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001783 "bigtableOptions": { # [Optional] Additional options if sourceFormat is set to BIGTABLE.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001784 "readRowkeyAsString": True or False, # [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001785 "ignoreUnspecifiedColumnFamilies": True or False, # [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
1786 "columnFamilies": [ # [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
1787 {
1788 "familyId": "A String", # Identifier of the column family.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001789 "type": "A String", # [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001790 "onlyReadLatest": True or False, # [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
1791 "columns": [ # [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
1792 {
1793 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
1794 "qualifierEncoded": "A String", # [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
1795 "fieldName": "A String", # [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
1796 "onlyReadLatest": True or False, # [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
1797 "qualifierString": "A String",
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001798 "type": "A String", # [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001799 },
1800 ],
1801 "encoding": "A String", # [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
1802 },
1803 ],
1804 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001805 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001806 "googleSheetsOptions": { # [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
1807 "skipLeadingRows": "A String", # [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
1808 },
1809 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001810 "fields": [ # Describes the fields in a table.
1811 {
1812 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1813 # Object with schema name: TableFieldSchema
1814 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001815 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001816 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1817 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
1818 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1819 },
1820 ],
1821 },
1822 },
1823 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001824 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
John Asmuth614db982014-04-24 15:46:26 -04001825 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001826 "copy": { # [Pick one] Copies a table.
1827 "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.
1828 "sourceTables": [ # [Pick one] Source tables to copy.
1829 {
1830 "projectId": "A String", # [Required] The ID of the project containing this table.
1831 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1832 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1833 },
1834 ],
1835 "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.
1836 "destinationTable": { # [Required] The destination table
1837 "projectId": "A String", # [Required] The ID of the project containing this table.
1838 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1839 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1840 },
1841 "sourceTable": { # [Pick one] Source table to copy.
1842 "projectId": "A String", # [Required] The ID of the project containing this table.
1843 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1844 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1845 },
1846 },
1847 "extract": { # [Pick one] Configures an extract job.
1848 "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.
1849 "compression": "A String", # [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE.
1850 "fieldDelimiter": "A String", # [Optional] Delimiter to use between fields in the exported data. Default is ','
1851 "destinationFormat": "A String", # [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV.
1852 "printHeader": true, # [Optional] Whether to print out a header row in the results. Default is true.
1853 "destinationUris": [ # [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
1854 "A String",
1855 ],
1856 "sourceTable": { # [Required] A reference to the table being exported.
1857 "projectId": "A String", # [Required] The ID of the project containing this table.
1858 "tableId": "A String", # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1859 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
1860 },
1861 },
John Asmuth614db982014-04-24 15:46:26 -04001862 },
1863 "id": "A String", # Unique opaque ID of the job.
1864 "errorResult": { # A result object that will be present only if the job has failed.
1865 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1866 "message": "A String", # A human-readable description of the error.
1867 "reason": "A String", # A short error code that summarizes the error.
1868 "location": "A String", # Specifies where the error occurred, if present.
1869 },
1870 },
1871 ],
1872 }</pre>
1873</div>
1874
1875<div class="method">
1876 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1877 <pre>Retrieves the next page of results.
1878
1879Args:
1880 previous_request: The request for the previous page. (required)
1881 previous_response: The response from the request for the previous page. (required)
1882
1883Returns:
1884 A request object that you can call 'execute()' on to request the next
1885 page. Returns None if there are no more items in the collection.
1886 </pre>
1887</div>
1888
1889<div class="method">
1890 <code class="details" id="query">query(projectId, body)</code>
1891 <pre>Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
1892
1893Args:
1894 projectId: string, Project ID of the project billed for the query (required)
1895 body: object, The request body. (required)
1896 The object takes the form of:
1897
1898{
1899 "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).
1900 "kind": "bigquery#queryRequest", # The resource type of the request.
Takashi Matsuo06694102015-09-11 13:55:40 -07001901 "dryRun": True or False, # [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001902 "parameterMode": "A String", # [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001903 "useQueryCache": true, # [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.
John Asmuth614db982014-04-24 15:46:26 -04001904 "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'.
Craig Citroe633be12015-03-02 13:40:36 -08001905 "projectId": "A String", # [Optional] The ID of the project containing this dataset.
1906 "datasetId": "A String", # [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -04001907 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001908 "useLegacySql": true, # Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false.
John Asmuth614db982014-04-24 15:46:26 -04001909 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001910 "queryParameters": [ # [Experimental] Query parameters for Standard SQL queries.
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001911 {
1912 "parameterType": { # [Required] The type of this parameter.
1913 "structTypes": [ # [Optional] The types of the fields of this struct, in order, if this is a struct.
1914 {
1915 "type": # Object with schema name: QueryParameterType # [Required] The type of this field.
1916 "description": "A String", # [Optional] Human-oriented description of the field.
1917 "name": "A String", # [Optional] The name of this field.
1918 },
1919 ],
1920 "type": "A String", # [Required] The top level type of this field.
1921 "arrayType": # Object with schema name: QueryParameterType # [Optional] The type of the array's elements, if this is an array.
1922 },
1923 "parameterValue": { # [Required] The value of this parameter.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001924 "structValues": { # [Optional] The struct field values, in order of the struct type's declaration.
1925 "a_key": # Object with schema name: QueryParameterValue
1926 },
Jon Wayne Parrott2512a0c2016-08-29 10:21:22 -07001927 "arrayValues": [ # [Optional] The array values, if this is an array type.
1928 # Object with schema name: QueryParameterValue
1929 ],
1930 "value": "A String", # [Optional] The value of this value, if a simple scalar type.
1931 },
1932 "name": "A String", # [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
1933 },
1934 ],
John Asmuth614db982014-04-24 15:46:26 -04001935 "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]".
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001936 "preserveNulls": True or False, # [Deprecated] This property is deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001937 }
1938
1939
1940Returns:
1941 An object of the form:
1942
1943 {
1944 "kind": "bigquery#queryResponse", # The resource type.
Takashi Matsuo06694102015-09-11 13:55:40 -07001945 "errors": [ # [Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001946 {
Takashi Matsuo06694102015-09-11 13:55:40 -07001947 "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used.
1948 "message": "A String", # A human-readable description of the error.
1949 "reason": "A String", # A short error code that summarizes the error.
1950 "location": "A String", # Specifies where the error occurred, if present.
John Asmuth614db982014-04-24 15:46:26 -04001951 },
1952 ],
1953 "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).
Craig Citroe633be12015-03-02 13:40:36 -08001954 "projectId": "A String", # [Required] The ID of the project containing this job.
1955 "jobId": "A String", # [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
John Asmuth614db982014-04-24 15:46:26 -04001956 },
1957 "pageToken": "A String", # A token used for paging results.
1958 "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.
1959 "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.
1960 "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.
1961 "cacheHit": True or False, # Whether the query result was fetched from the query cache.
Takashi Matsuo06694102015-09-11 13:55:40 -07001962 "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.
1963 {
1964 "f": [ # Represents a single row in the result set, consisting of one or more fields.
1965 {
1966 "v": "",
1967 },
1968 ],
1969 },
1970 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001971 "numDmlAffectedRows": "A String", # [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
John Asmuth614db982014-04-24 15:46:26 -04001972 "schema": { # The schema of the results. Present only when the query completes successfully.
1973 "fields": [ # Describes the fields in a table.
1974 {
1975 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
1976 # Object with schema name: TableFieldSchema
1977 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001978 "type": "A String", # [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
Craig Citroe633be12015-03-02 13:40:36 -08001979 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
1980 "name": "A String", # [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
John Asmuth614db982014-04-24 15:46:26 -04001981 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
1982 },
1983 ],
1984 },
1985 }</pre>
1986</div>
1987
1988</body></html>