blob: bda0cd3f23cfa389e8bf9b16d4b238d2873d3268 [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.tables.html">tables</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(projectId, datasetId, tableId)</a></code></p>
79<p class="firstline">Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.</p>
80<p class="toc_element">
81 <code><a href="#get">get(projectId, datasetId, tableId)</a></code></p>
82<p class="firstline">Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(projectId, datasetId, body)</a></code></p>
85<p class="firstline">Creates a new, empty table in the dataset.</p>
86<p class="toc_element">
87 <code><a href="#list">list(projectId, datasetId, pageToken=None, maxResults=None)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000088<p class="firstline">Lists all tables in the specified dataset. Requires the READER dataset role.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#patch">patch(projectId, datasetId, tableId, body)</a></code></p>
94<p class="firstline">Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.</p>
95<p class="toc_element">
96 <code><a href="#update">update(projectId, datasetId, tableId, body)</a></code></p>
97<p class="firstline">Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.</p>
98<h3>Method Details</h3>
99<div class="method">
100 <code class="details" id="delete">delete(projectId, datasetId, tableId)</code>
101 <pre>Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
102
103Args:
104 projectId: string, Project ID of the table to delete (required)
105 datasetId: string, Dataset ID of the table to delete (required)
106 tableId: string, Table ID of the table to delete (required)
107</pre>
108</div>
109
110<div class="method">
111 <code class="details" id="get">get(projectId, datasetId, tableId)</code>
112 <pre>Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
113
114Args:
115 projectId: string, Project ID of the requested table (required)
116 datasetId: string, Dataset ID of the requested table (required)
117 tableId: string, Table ID of the requested table (required)
118
119Returns:
120 An object of the form:
121
122 {
123 "kind": "bigquery#table", # [Output-only] The type of the resource.
124 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
125 "description": "A String", # [Optional] A user-friendly description of this table.
126 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800127 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
128 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700129 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
130 "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 (',').
131 "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.
132 "skipLeadingRows": 42, # [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.
133 "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.
134 "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.
135 "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.
136 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800137 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
138 "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 Datastore backups.
139 "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 Datastore backups: This setting is ignored.
140 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700141 "A String",
142 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800143 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700144 "fields": [ # Describes the fields in a table.
145 {
146 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
147 # Object with schema name: TableFieldSchema
148 ],
149 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
150 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
151 "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.
152 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
153 },
154 ],
155 },
156 },
John Asmuth614db982014-04-24 15:46:26 -0400157 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800158 "projectId": "A String", # [Required] The ID of the project containing this table.
159 "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.
160 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400161 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700162 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
163 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400164 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700165 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
166 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
167 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
168 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
169 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
170 },
John Asmuth614db982014-04-24 15:46:26 -0400171 "friendlyName": "A String", # [Optional] A descriptive name for this table.
172 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
173 "view": { # [Optional] The view definition.
174 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800175 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
176 {
177 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
178 "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.
179 },
180 ],
John Asmuth614db982014-04-24 15:46:26 -0400181 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800182 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400183 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
184 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
185 "schema": { # [Optional] Describes the schema of this table.
186 "fields": [ # Describes the fields in a table.
187 {
188 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
189 # Object with schema name: TableFieldSchema
190 ],
191 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800192 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
193 "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 -0400194 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
195 },
196 ],
197 },
198 }</pre>
199</div>
200
201<div class="method">
202 <code class="details" id="insert">insert(projectId, datasetId, body)</code>
203 <pre>Creates a new, empty table in the dataset.
204
205Args:
206 projectId: string, Project ID of the new table (required)
207 datasetId: string, Dataset ID of the new table (required)
208 body: object, The request body. (required)
209 The object takes the form of:
210
211{
212 "kind": "bigquery#table", # [Output-only] The type of the resource.
213 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
214 "description": "A String", # [Optional] A user-friendly description of this table.
215 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800216 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
217 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700218 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
219 "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 (',').
220 "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.
221 "skipLeadingRows": 42, # [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.
222 "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.
223 "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.
224 "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.
225 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800226 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
227 "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 Datastore backups.
228 "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 Datastore backups: This setting is ignored.
229 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700230 "A String",
231 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800232 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700233 "fields": [ # Describes the fields in a table.
234 {
235 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
236 # Object with schema name: TableFieldSchema
237 ],
238 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
239 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
240 "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.
241 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
242 },
243 ],
244 },
245 },
John Asmuth614db982014-04-24 15:46:26 -0400246 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800247 "projectId": "A String", # [Required] The ID of the project containing this table.
248 "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.
249 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400250 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700251 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
252 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400253 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700254 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
255 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
256 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
257 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
258 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
259 },
John Asmuth614db982014-04-24 15:46:26 -0400260 "friendlyName": "A String", # [Optional] A descriptive name for this table.
261 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
262 "view": { # [Optional] The view definition.
263 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800264 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
265 {
266 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
267 "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.
268 },
269 ],
John Asmuth614db982014-04-24 15:46:26 -0400270 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800271 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400272 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
273 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
274 "schema": { # [Optional] Describes the schema of this table.
275 "fields": [ # Describes the fields in a table.
276 {
277 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
278 # Object with schema name: TableFieldSchema
279 ],
280 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800281 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
282 "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 -0400283 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
284 },
285 ],
286 },
287 }
288
289
290Returns:
291 An object of the form:
292
293 {
294 "kind": "bigquery#table", # [Output-only] The type of the resource.
295 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
296 "description": "A String", # [Optional] A user-friendly description of this table.
297 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800298 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
299 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700300 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
301 "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 (',').
302 "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.
303 "skipLeadingRows": 42, # [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.
304 "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.
305 "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.
306 "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.
307 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800308 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
309 "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 Datastore backups.
310 "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 Datastore backups: This setting is ignored.
311 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700312 "A String",
313 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800314 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700315 "fields": [ # Describes the fields in a table.
316 {
317 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
318 # Object with schema name: TableFieldSchema
319 ],
320 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
321 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
322 "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.
323 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
324 },
325 ],
326 },
327 },
John Asmuth614db982014-04-24 15:46:26 -0400328 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800329 "projectId": "A String", # [Required] The ID of the project containing this table.
330 "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.
331 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400332 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700333 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
334 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400335 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700336 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
337 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
338 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
339 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
340 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
341 },
John Asmuth614db982014-04-24 15:46:26 -0400342 "friendlyName": "A String", # [Optional] A descriptive name for this table.
343 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
344 "view": { # [Optional] The view definition.
345 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800346 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
347 {
348 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
349 "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.
350 },
351 ],
John Asmuth614db982014-04-24 15:46:26 -0400352 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800353 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400354 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
355 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
356 "schema": { # [Optional] Describes the schema of this table.
357 "fields": [ # Describes the fields in a table.
358 {
359 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
360 # Object with schema name: TableFieldSchema
361 ],
362 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800363 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
364 "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 -0400365 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
366 },
367 ],
368 },
369 }</pre>
370</div>
371
372<div class="method">
373 <code class="details" id="list">list(projectId, datasetId, pageToken=None, maxResults=None)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000374 <pre>Lists all tables in the specified dataset. Requires the READER dataset role.
John Asmuth614db982014-04-24 15:46:26 -0400375
376Args:
377 projectId: string, Project ID of the tables to list (required)
378 datasetId: string, Dataset ID of the tables to list (required)
379 pageToken: string, Page token, returned by a previous call, to request the next page of results
380 maxResults: integer, Maximum number of results to return
381
382Returns:
383 An object of the form:
384
385 {
386 "nextPageToken": "A String", # A token to request the next page of results.
387 "tables": [ # Tables in the requested dataset.
388 {
389 "friendlyName": "A String", # The user-friendly name for this table.
390 "kind": "bigquery#table", # The resource type.
391 "type": "A String", # The type of table. Possible values are: TABLE, VIEW.
392 "id": "A String", # An opaque ID of the table
393 "tableReference": { # A reference uniquely identifying the table.
Craig Citroe633be12015-03-02 13:40:36 -0800394 "projectId": "A String", # [Required] The ID of the project containing this table.
395 "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.
396 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400397 },
398 },
399 ],
400 "kind": "bigquery#tableList", # The type of list.
401 "etag": "A String", # A hash of this page of results.
402 "totalItems": 42, # The total number of tables in the dataset.
403 }</pre>
404</div>
405
406<div class="method">
407 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
408 <pre>Retrieves the next page of results.
409
410Args:
411 previous_request: The request for the previous page. (required)
412 previous_response: The response from the request for the previous page. (required)
413
414Returns:
415 A request object that you can call 'execute()' on to request the next
416 page. Returns None if there are no more items in the collection.
417 </pre>
418</div>
419
420<div class="method">
421 <code class="details" id="patch">patch(projectId, datasetId, tableId, body)</code>
422 <pre>Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
423
424Args:
425 projectId: string, Project ID of the table to update (required)
426 datasetId: string, Dataset ID of the table to update (required)
427 tableId: string, Table ID of the table to update (required)
428 body: object, The request body. (required)
429 The object takes the form of:
430
431{
432 "kind": "bigquery#table", # [Output-only] The type of the resource.
433 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
434 "description": "A String", # [Optional] A user-friendly description of this table.
435 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800436 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
437 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700438 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
439 "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 (',').
440 "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.
441 "skipLeadingRows": 42, # [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.
442 "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.
443 "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.
444 "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.
445 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800446 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
447 "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 Datastore backups.
448 "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 Datastore backups: This setting is ignored.
449 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700450 "A String",
451 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800452 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700453 "fields": [ # Describes the fields in a table.
454 {
455 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
456 # Object with schema name: TableFieldSchema
457 ],
458 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
459 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
460 "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.
461 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
462 },
463 ],
464 },
465 },
John Asmuth614db982014-04-24 15:46:26 -0400466 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800467 "projectId": "A String", # [Required] The ID of the project containing this table.
468 "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.
469 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400470 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700471 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
472 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400473 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700474 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
475 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
476 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
477 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
478 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
479 },
John Asmuth614db982014-04-24 15:46:26 -0400480 "friendlyName": "A String", # [Optional] A descriptive name for this table.
481 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
482 "view": { # [Optional] The view definition.
483 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800484 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
485 {
486 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
487 "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.
488 },
489 ],
John Asmuth614db982014-04-24 15:46:26 -0400490 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800491 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400492 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
493 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
494 "schema": { # [Optional] Describes the schema of this table.
495 "fields": [ # Describes the fields in a table.
496 {
497 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
498 # Object with schema name: TableFieldSchema
499 ],
500 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800501 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
502 "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 -0400503 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
504 },
505 ],
506 },
507 }
508
509
510Returns:
511 An object of the form:
512
513 {
514 "kind": "bigquery#table", # [Output-only] The type of the resource.
515 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
516 "description": "A String", # [Optional] A user-friendly description of this table.
517 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800518 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
519 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700520 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
521 "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 (',').
522 "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.
523 "skipLeadingRows": 42, # [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.
524 "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.
525 "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.
526 "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.
527 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800528 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
529 "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 Datastore backups.
530 "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 Datastore backups: This setting is ignored.
531 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700532 "A String",
533 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800534 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700535 "fields": [ # Describes the fields in a table.
536 {
537 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
538 # Object with schema name: TableFieldSchema
539 ],
540 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
541 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
542 "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.
543 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
544 },
545 ],
546 },
547 },
John Asmuth614db982014-04-24 15:46:26 -0400548 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800549 "projectId": "A String", # [Required] The ID of the project containing this table.
550 "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.
551 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400552 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700553 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
554 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400555 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700556 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
557 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
558 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
559 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
560 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
561 },
John Asmuth614db982014-04-24 15:46:26 -0400562 "friendlyName": "A String", # [Optional] A descriptive name for this table.
563 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
564 "view": { # [Optional] The view definition.
565 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800566 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
567 {
568 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
569 "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.
570 },
571 ],
John Asmuth614db982014-04-24 15:46:26 -0400572 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800573 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400574 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
575 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
576 "schema": { # [Optional] Describes the schema of this table.
577 "fields": [ # Describes the fields in a table.
578 {
579 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
580 # Object with schema name: TableFieldSchema
581 ],
582 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800583 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
584 "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 -0400585 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
586 },
587 ],
588 },
589 }</pre>
590</div>
591
592<div class="method">
593 <code class="details" id="update">update(projectId, datasetId, tableId, body)</code>
594 <pre>Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
595
596Args:
597 projectId: string, Project ID of the table to update (required)
598 datasetId: string, Dataset ID of the table to update (required)
599 tableId: string, Table ID of the table to update (required)
600 body: object, The request body. (required)
601 The object takes the form of:
602
603{
604 "kind": "bigquery#table", # [Output-only] The type of the resource.
605 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
606 "description": "A String", # [Optional] A user-friendly description of this table.
607 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800608 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
609 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700610 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
611 "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 (',').
612 "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.
613 "skipLeadingRows": 42, # [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.
614 "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.
615 "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.
616 "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.
617 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800618 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
619 "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 Datastore backups.
620 "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 Datastore backups: This setting is ignored.
621 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700622 "A String",
623 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800624 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700625 "fields": [ # Describes the fields in a table.
626 {
627 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
628 # Object with schema name: TableFieldSchema
629 ],
630 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
631 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
632 "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.
633 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
634 },
635 ],
636 },
637 },
John Asmuth614db982014-04-24 15:46:26 -0400638 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800639 "projectId": "A String", # [Required] The ID of the project containing this table.
640 "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.
641 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400642 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700643 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
644 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400645 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700646 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
647 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
648 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
649 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
650 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
651 },
John Asmuth614db982014-04-24 15:46:26 -0400652 "friendlyName": "A String", # [Optional] A descriptive name for this table.
653 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
654 "view": { # [Optional] The view definition.
655 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800656 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
657 {
658 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
659 "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.
660 },
661 ],
John Asmuth614db982014-04-24 15:46:26 -0400662 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800663 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400664 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
665 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
666 "schema": { # [Optional] Describes the schema of this table.
667 "fields": [ # Describes the fields in a table.
668 {
669 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
670 # Object with schema name: TableFieldSchema
671 ],
672 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800673 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
674 "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 -0400675 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
676 },
677 ],
678 },
679 }
680
681
682Returns:
683 An object of the form:
684
685 {
686 "kind": "bigquery#table", # [Output-only] The type of the resource.
687 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
688 "description": "A String", # [Optional] A user-friendly description of this table.
689 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800690 "externalDataConfiguration": { # [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
691 "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 Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700692 "csvOptions": { # Additional properties to set if sourceFormat is set to CSV.
693 "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 (',').
694 "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.
695 "skipLeadingRows": 42, # [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.
696 "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.
697 "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.
698 "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.
699 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800700 "sourceFormat": "A String", # [Required] The data format. For CSV files, specify "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP".
701 "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 Datastore backups.
702 "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 Datastore backups: This setting is ignored.
703 "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. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs. 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700704 "A String",
705 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800706 "schema": { # [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Datastore backups.
Takashi Matsuo06694102015-09-11 13:55:40 -0700707 "fields": [ # Describes the fields in a table.
708 {
709 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
710 # Object with schema name: TableFieldSchema
711 ],
712 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
713 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
714 "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.
715 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
716 },
717 ],
718 },
719 },
John Asmuth614db982014-04-24 15:46:26 -0400720 "tableReference": { # [Required] Reference describing the ID of this table.
Craig Citroe633be12015-03-02 13:40:36 -0800721 "projectId": "A String", # [Required] The ID of the project containing this table.
722 "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.
723 "datasetId": "A String", # [Required] The ID of the dataset containing this table.
John Asmuth614db982014-04-24 15:46:26 -0400724 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700725 "numRows": "A String", # [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
726 "numBytes": "A String", # [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
John Asmuth614db982014-04-24 15:46:26 -0400727 "etag": "A String", # [Output-only] A hash of this resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700728 "location": "A String", # [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
729 "streamingBuffer": { # [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
730 "estimatedBytes": "A String", # [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
731 "estimatedRows": "A String", # [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
732 "oldestEntryTime": "A String", # [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
733 },
John Asmuth614db982014-04-24 15:46:26 -0400734 "friendlyName": "A String", # [Optional] A descriptive name for this table.
735 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
736 "view": { # [Optional] The view definition.
737 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800738 "userDefinedFunctionResources": [ # [Experimental] Describes user-defined function resources used in the query.
739 {
740 "resourceUri": "A String", # [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
741 "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.
742 },
743 ],
John Asmuth614db982014-04-24 15:46:26 -0400744 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800745 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
John Asmuth614db982014-04-24 15:46:26 -0400746 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
747 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
748 "schema": { # [Optional] Describes the schema of this table.
749 "fields": [ # Describes the fields in a table.
750 {
751 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
752 # Object with schema name: TableFieldSchema
753 ],
754 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
Craig Citroe633be12015-03-02 13:40:36 -0800755 "description": "A String", # [Optional] The field description. The maximum length is 16K characters.
756 "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 -0400757 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
758 },
759 ],
760 },
761 }</pre>
762</div>
763
764</body></html>