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 isn't possible to resume the read, and the whole operation must be restarted from the beginning.
sessions.read only snapshot transactions are supported, read/write and single use transactions are not.
table
string
Required. The name of the table in the database to be read.
index
string
If non-empty, the name of an index on table. This index is used instead of the table primary key when interpreting keySet and sorting result rows. See keySet for further information.
columns[]
string
The columns of table to be returned for each row matching this request.
Required. keySet identifies the rows to be yielded. keySet names the primary keys of the rows in table to be yielded, unless index is present. If index is present, then keySet instead names index keys in index.
It isn't an error for the keySet to name rows that don't exist in the database. sessions.read yields nothing for nonexistent rows.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-18 UTC."],[],[],null,["# Method: projects.instances.databases.sessions.partitionRead\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates 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](/spanner/docs/reference/rest/v1/projects.instances.databases.sessions/streamingRead#google.spanner.v1.Spanner.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`.\n\nPartition 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 isn't possible to resume the read, and the whole operation must be restarted from the beginning.\n\n### HTTP request\n\nChoose a location: \nglobal europe-west8 me-central2 us-central1 us-central2 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2 us-west3 us-west4 us-west8 us-east7 \n\n\u003cbr /\u003e\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [PartitionResponse](/spanner/docs/reference/rest/v1/PartitionResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/spanner.data`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]