Database Reference
In-Depth Information
not a strong guarantee, which is why this API has at-least-once semantics.
To summarize, using a unique insertId for each record inserted reduces
the chance of duplication but does not eliminate all duplication.
WARNING
The insert operation implemented in the bq tool does not
supply insert IDs to the API. This makes in unsuitable for
production usage, but it is convenient to use during
development and testing.
Now turn to the response returned by the insert request. The response is
used to report the errors that occurred while processing the insert. As you
saw, when the request succeeds, the response is basically empty. Errors
that cause the entire request to fail return an HTTP error status code and
the body contains additional details. Otherwise, a 200 status is returned,
and the response contains information about individual rows that failed.
This is analogous to how load job errors are handled. You can see the error
reporting in action by issuing a couple of bad requests. To give you a better
sense of the actual HTTP requests and responses, use curl to manually
construct the requests.
$ curl -H "$(python auth.py)" \
-H 'Content-Type: application/json' \
--data-binary '{
"rows": [
{"json": {"count": "4.2", "ts": 123, "label":
"bad"}}
]
}' $(table_url foo)/insertAll
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found: Table 317752944021:ch06.foo"
Search WWH ::




Custom Search