Method: projects.instances.databases.sessions.streamingRead

Like sessions.read, except returns the result set as a stream. Unlike sessions.read, there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB.

HTTP request

POST https://spanner.googleapis.com/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead

The URL uses Google API HTTP annotation syntax.

Path parameters

Parameters
session

string

Required. The session in which the read should be performed.

Authorization requires the following Google IAM permission on the specified resource session:

  • spanner.databases.read

Request body

The request body contains data with the following structure:

JSON representation
{
  "transaction": {
    object(TransactionSelector)
  },
  "table": string,
  "index": string,
  "columns": [
    string
  ],
  "keySet": {
    object(KeySet)
  },
  "limit": string,
  "resumeToken": string,
}
Fields
transaction

object(TransactionSelector)

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.

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.

keySet

object(KeySet)

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.

Rows are yielded in table primary key order (if index is empty) or index key order (if index is non-empty).

It is not an error for the keySet to name rows that do not exist in the database. sessions.read yields nothing for nonexistent rows.

limit

string (int64 format)

If greater than zero, only the first limit rows are yielded. If limit is zero, the default is no limit.

resumeToken

string (bytes format)

If this request is resuming a previously interrupted read, resumeToken should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new read to resume where the last read left off. The rest of the request parameters must exactly match the request that yielded this token.

A base64-encoded string.

Response body

If successful, the response body contains an instance of PartialResultSet.

Authorization

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 Auth Guide.

Try it!

Send feedback about...

Cloud Spanner Documentation