John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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.tabledata.html">tabledata</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#insertAll">insertAll(projectId, datasetId, tableId, body=None)</a></code></p> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 79 | <p class="firstline">Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.</p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 80 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 81 | <code><a href="#list">list(projectId, datasetId, tableId, pageToken=None, maxResults=None, selectedFields=None, startIndex=None)</a></code></p> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 82 | <p class="firstline">Retrieves table data from a specified set of rows. Requires the READER dataset role.</p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 83 | <p class="toc_element"> |
| 84 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 85 | <p class="firstline">Retrieves the next page of results.</p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 86 | <h3>Method Details</h3> |
| 87 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 88 | <code class="details" id="insertAll">insertAll(projectId, datasetId, tableId, body=None)</code> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 89 | <pre>Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 90 | |
| 91 | Args: |
| 92 | projectId: string, Project ID of the destination table. (required) |
| 93 | datasetId: string, Dataset ID of the destination table. (required) |
| 94 | tableId: string, Table ID of the destination table. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 95 | body: object, The request body. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 96 | The object takes the form of: |
| 97 | |
| 98 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 99 | "rows": [ # The rows to insert. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 100 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 101 | "insertId": "A String", # [Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis. |
| 102 | "json": { # Represents a single JSON object. # [Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema. |
| 103 | "a_key": "", |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 104 | }, |
| 105 | }, |
| 106 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 107 | "kind": "bigquery#tableDataInsertAllRequest", # The resource type of the response. |
| 108 | "templateSuffix": "A String", # If specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables. |
| 109 | "ignoreUnknownValues": True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors. |
| 110 | "skipInvalidRows": True or False, # [Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | |
| 114 | Returns: |
| 115 | An object of the form: |
| 116 | |
| 117 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 118 | "insertErrors": [ # An array of errors for rows that were not inserted. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 119 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 120 | "errors": [ # Error information for the row indicated by the index property. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 121 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 122 | "message": "A String", # A human-readable description of the error. |
| 123 | "location": "A String", # Specifies where the error occurred, if present. |
| 124 | "debugInfo": "A String", # Debugging information. This property is internal to Google and should not be used. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 125 | "reason": "A String", # A short error code that summarizes the error. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 126 | }, |
| 127 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 128 | "index": 42, # The index of the row that error applies to. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 129 | }, |
| 130 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 131 | "kind": "bigquery#tableDataInsertAllResponse", # The resource type of the response. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 132 | }</pre> |
| 133 | </div> |
| 134 | |
| 135 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 136 | <code class="details" id="list">list(projectId, datasetId, tableId, pageToken=None, maxResults=None, selectedFields=None, startIndex=None)</code> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 137 | <pre>Retrieves table data from a specified set of rows. Requires the READER dataset role. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 138 | |
| 139 | Args: |
| 140 | projectId: string, Project ID of the table to read (required) |
| 141 | datasetId: string, Dataset ID of the table to read (required) |
| 142 | tableId: string, Table ID of the table to read (required) |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 143 | pageToken: string, Page token, returned by a previous call, identifying the result set |
| 144 | maxResults: integer, Maximum number of results to return |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 145 | selectedFields: string, List of fields to return (comma-separated). If unspecified, all fields are returned |
| 146 | startIndex: string, Zero-based index of the starting row to read |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 147 | |
| 148 | Returns: |
| 149 | An object of the form: |
| 150 | |
| 151 | { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 152 | "totalRows": "A String", # The total number of rows in the complete table. |
| 153 | "etag": "A String", # A hash of this page of results. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 154 | "rows": [ # Rows of results. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 155 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 156 | "f": [ # Represents a single row in the result set, consisting of one or more fields. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 157 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 158 | "v": "", |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 159 | }, |
| 160 | ], |
| 161 | }, |
| 162 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 163 | "pageToken": "A String", # A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing. |
| 164 | "kind": "bigquery#tableDataList", # The resource type of the response. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 165 | }</pre> |
| 166 | </div> |
| 167 | |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 168 | <div class="method"> |
| 169 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 170 | <pre>Retrieves the next page of results. |
| 171 | |
| 172 | Args: |
| 173 | previous_request: The request for the previous page. (required) |
| 174 | previous_response: The response from the request for the previous page. (required) |
| 175 | |
| 176 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 177 | A request object that you can call 'execute()' on to request the next |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 178 | page. Returns None if there are no more items in the collection. |
| 179 | </pre> |
| 180 | </div> |
| 181 | |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 182 | </body></html> |