回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我尝试使用BigQuery的Python API创建新表:</p>
<pre><code>bigquery.tables().insert(
projectId="xxxxxxxxxxxxxx",
<a href="https://www.cnpython.com/pypi/dataset" class="inner-link">dataset</a>Id="xxxxxxxxxxxxxx",
body='{
"tableReference": {
"projectId":"xxxxxxxxxxxxxx",
"tableId":"xxxxxxxxxxxxxx",
"datasetId":"accesslog"},
"schema": {
"fields": [
{"type":"STRING", "name":"ip"},
{"type":"TIMESTAMP", "name":"ts"},
{"type":"STRING", "name":"event"},
{"type":"STRING", "name":"id"},
{"type":"STRING","name":"sh"},
{"type":"STRING", "name":"pub"},
{"type":"STRING", "name":"context"},
{"type":"STRING", "name":"brand"},
{"type":"STRING", "name":"product"}
]
}
}'
).execute()
</code></pre>
<p>我得到的错误是:</p>
^{pr2}$
<p>我认为只要在<a href="https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tables.html#insert" rel="nofollow">https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tables.html#insert</a>上有文档记录,所有必需的参数都包括在内</p>
<p>少了什么?在</p>