Database Reference
In-Depth Information
HTTP/1.1 308 Resume Incomplete
Content-Length: 0
Range: 0-42
The response indicates that the client needs to resume uploading from byte
43 (0-indexed). Uploading a range that has already been accepted leads to
undefined behavior, so don't do that. Also, if the upload is never completed,
it simply times out and the request is deemed incomplete. The upload and
request are considered complete when the last byte of the range is supplied.
If the size was not specified upfront, the final request must contain the
total size rather than “ * ” so that the server can determine that the upload
is complete. Completing the upload triggers the final request processing,
so the response to the PUT request that completes the upload contains the
response to the initial insert request. Because this was a job insert request,
it contains the load job that was inserted. All other operations on the job
proceed via the standard request path.
As mentioned earlier when using the Python or Java client, all these details
are hidden from the programmer. All that needs to be supplied is the file
(or file-like) object to be uploaded and a flag indicating that the Resumable
Upload protocol should be employed. If all you need to do is load data into
BigQuery for analysis, most of the time the Resumable Upload protocol is
the appropriate way to move your data.
Multipart Upload
You have now covered uploading data before creating a load job and
uploading data after creating one. BigQuery also supports uploading data
in the same request that creates the load job. This approach is not well
suited for large data transfers because it relies on moving all the data in
a single HTTP request, which becomes less reliable with increasing upload
sizes. If at all feasible it is preferable to use the Resumable Upload method.
However, in some scenarios it is not convenient to implement the resumable
protocol because it requires multiple HTTP operations. In this case you
can use multipart uploads, which are based on the widely used MIME
multipart standard ( http://www.w3.org/Protocols/rfc1341/
7_2_Multipart.html ) . The standard is a scheme for packing multiple
objects into a single stream of bytes. It is used to transfer attachments in an
e-mail message and for file uploads from browsers as part of web forms. The
Content-Type header specifies a string (chosen so that it does not collide
Search WWH ::




Custom Search