Creates a set of partition tokens that can be used to execute a read operation in parallel. Each of the returned partition tokens can be used by sessions.streamingRead
to specify a subset of the read result to read. The same session and read-only transaction must be used by the PartitionReadRequest used to create the partition tokens and the ReadRequests that use the partition tokens. There are no ordering guarantees on rows returned among the returned partition tokens, or even within each individual sessions.streamingRead call issued with a partitionToken.
Partition tokens become invalid when the session used to create them is deleted, is idle for too long, begins a new transaction, or becomes too old. When any of these happen, it is not possible to resume the read, and the whole operation must be restarted from the beginning.
HTTP request
POST https://spanner.googleapis.com/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
session |
Required. The session used to create the partitions. Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "transaction": { object ( |
Fields | |
---|---|
transaction |
sessions.read only snapshot transactions are supported, read/write and single use transactions are not. |
table |
Required. The name of the table in the database to be read. |
index |
If non-empty, the name of an index on |
columns[] |
The columns of |
key |
Required. It is not an error for the |
partition |
Additional options that affect how many partitions are created. |
Response body
If successful, the response body contains an instance of PartitionResponse
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/spanner.data
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.