diff --git a/google/spanner/v1/spanner.proto b/google/spanner/v1/spanner.proto index 68d31a47b585a..367928a451556 100644 --- a/google/spanner/v1/spanner.proto +++ b/google/spanner/v1/spanner.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.spanner.v1; +import public "google/spanner/v1/commit_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -24,7 +26,6 @@ import "google/protobuf/empty.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import public "google/spanner/v1/commit_response.proto"; import "google/spanner/v1/keys.proto"; import "google/spanner/v1/mutation.proto"; import "google/spanner/v1/result_set.proto"; @@ -84,7 +85,8 @@ service Spanner { // // This API can be used to initialize a session cache on the clients. // See https://goo.gl/TgSFN2 for best practices on session cache management. - rpc BatchCreateSessions(BatchCreateSessionsRequest) returns (BatchCreateSessionsResponse) { + rpc BatchCreateSessions(BatchCreateSessionsRequest) + returns (BatchCreateSessionsResponse) { option (google.api.http) = { post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" body: "*" @@ -127,10 +129,12 @@ service Spanner { // // Operations inside read-write transactions might return `ABORTED`. If // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. // // Larger result sets can be fetched in streaming fashion by calling - // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + // instead. rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" @@ -138,11 +142,11 @@ service Spanner { }; } - // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result - // set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], 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. + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + // result set as a stream. Unlike + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], 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. rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" @@ -155,13 +159,15 @@ service Spanner { // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. // // Statements are executed in sequential order. A request can succeed even if - // a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the - // response provides information about the statement that failed. Clients must - // inspect this field to determine whether an error occurred. + // a statement fails. The + // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + // field in the response provides information about the statement that failed. + // Clients must inspect this field to determine whether an error occurred. // // Execution stops after the first failed statement; the remaining statements // are not executed. - rpc ExecuteBatchDml(ExecuteBatchDmlRequest) returns (ExecuteBatchDmlResponse) { + rpc ExecuteBatchDml(ExecuteBatchDmlRequest) + returns (ExecuteBatchDmlResponse) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" body: "*" @@ -170,14 +176,15 @@ service Spanner { // Reads rows from the database using key lookups and scans, as a // simple key/value style alternative to - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to - // return a result set larger than 10 MiB; if the read matches more + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be + // used to return a result set larger than 10 MiB; if the read matches more // data than that, the read fails with a `FAILED_PRECONDITION` // error. // // Reads inside read-write transactions might return `ABORTED`. If // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. // // Larger result sets can be yielded in streaming fashion by calling // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. @@ -188,9 +195,9 @@ service Spanner { }; } - // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a - // stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the - // size of the returned result set. However, no individual row in + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + // as a stream. Unlike [Read][google.spanner.v1.Spanner.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. rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { @@ -201,7 +208,8 @@ service Spanner { } // Begins a new transaction. This step can often be skipped: - // [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a // side-effect. rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { @@ -232,13 +240,15 @@ service Spanner { body: "*" }; option (google.api.method_signature) = "session,transaction_id,mutations"; - option (google.api.method_signature) = "session,single_use_transaction,mutations"; + option (google.api.method_signature) = + "session,single_use_transaction,mutations"; } // Rolls back a transaction, releasing any locks it holds. It is a good // idea to call this for any transaction that includes one or more - // [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and - // ultimately decides not to commit. + // [Read][google.spanner.v1.Spanner.Read] or + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + // decides not to commit. // // `Rollback` returns `OK` if it successfully aborts the transaction, the // transaction was already aborted, or the transaction is not @@ -253,10 +263,11 @@ service Spanner { // Creates a set of partition tokens that can be used to execute a query // operation in parallel. Each of the returned partition tokens can be used - // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset - // of the query result to read. The same session and read-only transaction - // must be used by the PartitionQueryRequest used to create the - // partition tokens and the ExecuteSqlRequests that use the partition tokens. + // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + // specify a subset of the query result to read. The same session and + // read-only transaction must be used by the PartitionQueryRequest used to + // create the partition tokens and the ExecuteSqlRequests that use the + // partition tokens. // // 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 @@ -271,12 +282,13 @@ service Spanner { // 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 [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 StreamingRead call issued with a partition_token. + // by [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 StreamingRead call issued with a + // partition_token. // // 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 @@ -327,7 +339,8 @@ message CreateSessionRequest { Session session = 2 [(google.api.field_behavior) = REQUIRED]; } -// The request for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +// The request for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. message BatchCreateSessionsRequest { // Required. The database in which the new sessions are created. string database = 1 [ @@ -344,11 +357,13 @@ message BatchCreateSessionsRequest { // The API may return fewer than the requested number of sessions. If a // specific number of sessions are desired, the client can make additional // calls to BatchCreateSessions (adjusting - // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + // as necessary). int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; } -// The response for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +// The response for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. message BatchCreateSessionsResponse { // The freshly created sessions. repeated Session session = 1; @@ -376,11 +391,13 @@ message Session { map labels = 2; // Output only. The timestamp when the session is created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The approximate timestamp when the session is last used. It is // typically earlier than the actual last use time. - google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp approximate_last_use_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The database role which created this session. string creator_role = 5; @@ -391,9 +408,7 @@ message GetSessionRequest { // Required. The name of the session to retrieve. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; } @@ -412,7 +427,8 @@ message ListSessionsRequest { int32 page_size = 2; // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + // from a previous // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. string page_token = 3; @@ -435,8 +451,8 @@ message ListSessionsResponse { repeated Session sessions = 1; // `next_page_token` can be sent in a subsequent - // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - // sessions. + // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + // of the matching sessions. string next_page_token = 2; } @@ -445,9 +461,7 @@ message DeleteSessionRequest { // Required. The name of the session to delete. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; } @@ -512,6 +526,86 @@ message RequestOptions { string transaction_tag = 3; } +// The DirectedReadOptions can be used to indicate which replicas or regions +// should be used for non-transactional reads or queries. +// +// DirectedReadOptions may only be specified for a read-only transaction, +// otherwise the API will return an `INVALID_ARGUMENT` error. +message DirectedReadOptions { + // The directed read replica selector. + // Callers must provide one or more of the following fields for replica + // selection: + // + // * `location` - The location must be one of the regions within the + // multi-region configuration of your database. + // * `type` - The type of the replica. + // + // Some examples of using replica_selectors are: + // + // * `location:us-east1` --> The "us-east1" replica(s) of any available type + // will be used to process the request. + // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest + // . available location will be used to process the + // request. + // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + // in location "us-east1" will be used to process + // the request. + message ReplicaSelection { + // Indicates the type of replica. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). + READ_ONLY = 2; + } + + // The location or region of the serving requests, e.g. "us-east1". + string location = 1; + + // The type of replica. + Type type = 2; + } + + // An IncludeReplicas contains a repeated set of ReplicaSelection which + // indicates the order in which replicas should be considered. + message IncludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + + // If true, Spanner will not route requests to a replica outside the + // include_replicas list when all of the specified replicas are unavailable + // or unhealthy. Default value is `false`. + bool auto_failover_disabled = 2; + } + + // An ExcludeReplicas contains a repeated set of ReplicaSelection that should + // be excluded from serving requests. + message ExcludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + } + + // Required. Replicas indicates the order in which replicas should be + // considered. At most one of either include_replicas or exclude_replicas + // should be present in the message. + oneof replicas { + // Include_replicas indicates the order of replicas (as they appear in + // this list) to process the request. If auto_failover_disabled is set to + // true and all replicas are exhausted without finding a healthy replica, + // Spanner will wait for a replica in the list to become available, requests + // may fail due to `DEADLINE_EXCEEDED` errors. + IncludeReplicas include_replicas = 1; + + // Exclude_replicas indicates that should be excluded from serving + // requests. Spanner will not route requests to the replicas in this list. + ExcludeReplicas exclude_replicas = 2; + } +} + // The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. message ExecuteSqlRequest { @@ -585,9 +679,7 @@ message ExecuteSqlRequest { // Required. The session in which the SQL query should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // The transaction to use. @@ -622,7 +714,8 @@ message ExecuteSqlRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL statement parameters. See the @@ -632,15 +725,18 @@ message ExecuteSqlRequest { // If this request is resuming a previously interrupted SQL statement // execution, `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - // enables the new SQL statement execution to resume where the last one left - // off. The rest of the request parameters must exactly match the - // request that yielded this token. + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new SQL statement execution to resume + // where the last one left off. The rest of the request parameters must + // exactly match the request that yielded this token. bytes resume_token = 6; // Used to control the amount of debugging information returned in - // [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - // be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + // [ResultSetStats][google.spanner.v1.ResultSetStats]. If + // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + // be set to + // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. QueryMode query_mode = 7; // If present, results will be restricted to the specified partition @@ -667,11 +763,14 @@ message ExecuteSqlRequest { // Common options for this request. RequestOptions request_options = 11; + // Directed read options for this request. + DirectedReadOptions directed_read_options = 15; + // If this is for a partitioned query and this field is set to `true`, the - // request will be executed via Spanner independent compute resources. + // request is executed with Spanner Data Boost independent compute resources. // // If the field is set to `true` but the request does not set - // `partition_token`, the API will return an `INVALID_ARGUMENT` error. + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. bool data_boost_enabled = 16; } @@ -698,7 +797,9 @@ message ExecuteBatchDmlRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + // JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL statement parameters. See the @@ -710,9 +811,7 @@ message ExecuteBatchDmlRequest { // Required. The session in which the DML statements should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction to use. Must be a read-write transaction. @@ -722,17 +821,17 @@ message ExecuteBatchDmlRequest { // transaction. TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The list of statements to execute in this batch. Statements are executed - // serially, such that the effects of statement `i` are visible to statement - // `i+1`. Each statement must be a DML statement. Execution stops at the - // first failed statement; the remaining statements are not executed. + // Required. The list of statements to execute in this batch. Statements are + // executed serially, such that the effects of statement `i` are visible to + // statement `i+1`. Each statement must be a DML statement. Execution stops at + // the first failed statement; the remaining statements are not executed. // // Callers must provide at least one statement. repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; - // Required. A per-transaction sequence number used to identify this request. This field - // makes each request idempotent such that if the request is received multiple - // times, at most one will succeed. + // Required. A per-transaction sequence number used to identify this request. + // This field makes each request idempotent such that if the request is + // received multiple times, at most one will succeed. // // The sequence number must be monotonically increasing within the // transaction. If a request arrives for the first time with an out-of-order @@ -744,38 +843,47 @@ message ExecuteBatchDmlRequest { RequestOptions request_options = 5; } -// The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list -// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML statement that has successfully -// executed, in the same order as the statements in the request. If a statement -// fails, the status in the response body identifies the cause of the failure. +// The response for +// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list +// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML +// statement that has successfully executed, in the same order as the statements +// in the request. If a statement fails, the status in the response body +// identifies the cause of the failure. // // To check for DML statements that failed, use the following approach: // -// 1. Check the status in the response message. The [google.rpc.Code][google.rpc.Code] enum +// 1. Check the status in the response message. The +// [google.rpc.Code][google.rpc.Code] enum // value `OK` indicates that all statements were executed successfully. // 2. If the status was not `OK`, check the number of result sets in the -// response. If the response contains `N` [ResultSet][google.spanner.v1.ResultSet] messages, then -// statement `N+1` in the request failed. +// response. If the response contains `N` +// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in +// the request failed. // // Example 1: // // * Request: 5 DML statements, all executed successfully. -// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the status `OK`. +// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the +// status `OK`. // // Example 2: // // * Request: 5 DML statements. The third statement has a syntax error. -// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax error (`INVALID_ARGUMENT`) -// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages indicates that the third -// statement failed, and the fourth and fifth statements were not executed. +// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax +// error (`INVALID_ARGUMENT`) +// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages +// indicates that the third statement failed, and the fourth and fifth +// statements were not executed. message ExecuteBatchDmlResponse { - // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - // in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - // not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - // the number of rows modified by the statement. + // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + // request that ran successfully, in the same order as the statements in the + // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + // modified by the statement. // - // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - // [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. repeated ResultSet result_sets = 1; // If all DML statements are executed successfully, the status is `OK`. @@ -810,24 +918,23 @@ message PartitionQueryRequest { // Required. The session used to create the partitions. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Read only snapshot transactions are supported, read/write and single use // transactions are not. TransactionSelector transaction = 2; - // Required. The query request to generate partitions for. The request will fail if - // the query is not root partitionable. The query plan of a root - // partitionable query has a single distributed union operator. A distributed - // union operator conceptually divides one or more tables into multiple - // splits, remotely evaluates a subquery independently on each split, and - // then unions all results. + // Required. The query request to generate partitions for. The request will + // fail if the query is not root partitionable. For a query to be root + // partitionable, it needs to satisfy a few conditions. For example, the first + // operator in the query execution plan must be a distributed union operator. + // For more information about other conditions, see [Read data in + // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). // - // This must not contain DML commands, such as INSERT, UPDATE, or - // DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + // The query request must not contain DML commands, such as INSERT, UPDATE, or + // DELETE. Use + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a // PartitionedDml transaction for large, partition-friendly DML operations. string sql = 3 [(google.api.field_behavior) = REQUIRED]; @@ -847,7 +954,8 @@ message PartitionQueryRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL query parameters. See the @@ -864,9 +972,7 @@ message PartitionReadRequest { // Required. The session used to create the partitions. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Read only snapshot transactions are supported, read/write and single use @@ -876,18 +982,24 @@ message PartitionReadRequest { // Required. The name of the table in the database to be read. string table = 3 [(google.api.field_behavior) = REQUIRED]; - // If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - // used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - // and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + // If non-empty, the name of an index on + // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + // instead of the table primary key when interpreting + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + // for further information. string index = 4; - // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - // this request. + // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + // returned for each row matching this request. repeated string columns = 5; // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - // is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + // primary keys of the rows in + // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + // [index][google.spanner.v1.PartitionReadRequest.index] is present. If + // [index][google.spanner.v1.PartitionReadRequest.index] is present, then + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. // // It is not an error for the `key_set` to name rows that do not @@ -923,9 +1035,7 @@ message ReadRequest { // Required. The session in which the read should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // The transaction to use. If none is provided, the default is a @@ -935,24 +1045,31 @@ message ReadRequest { // Required. The name of the table in the database to be read. string table = 3 [(google.api.field_behavior) = REQUIRED]; - // If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - // used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - // and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + // If non-empty, the name of an index on + // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + // the table primary key when interpreting + // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + // See [key_set][google.spanner.v1.ReadRequest.key_set] for further + // information. string index = 4; - // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - // this request. + // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + // returned for each row matching this request. repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - // is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - // index keys in [index][google.spanner.v1.ReadRequest.index]. + // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + // If [index][google.spanner.v1.ReadRequest.index] is present, then + // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + // in [index][google.spanner.v1.ReadRequest.index]. // - // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - // in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - // empty, rows will be yielded in an unspecified order. + // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + // field is empty, rows are yielded in table primary key order (if + // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + // [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + // not empty, rows will be yielded in an unspecified order. // // It is not an error for the `key_set` to name rows that do not // exist in the database. Read yields nothing for nonexistent rows. @@ -965,9 +1082,9 @@ message ReadRequest { // If this request is resuming a previously interrupted read, // `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.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 + // [PartialResultSet][google.spanner.v1.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. bytes resume_token = 9; @@ -980,22 +1097,24 @@ message ReadRequest { // Common options for this request. RequestOptions request_options = 11; + // Directed read options for this request. + DirectedReadOptions directed_read_options = 14; + // If this is for a partitioned read and this field is set to `true`, the - // request will be executed via Spanner independent compute resources. + // request is executed with Spanner Data Boost independent compute resources. // // If the field is set to `true` but the request does not set - // `partition_token`, the API will return an `INVALID_ARGUMENT` error. + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. bool data_boost_enabled = 15; } -// The request for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. +// The request for +// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. message BeginTransactionRequest { // Required. The session in which the transaction runs. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. Options for the new transaction. @@ -1014,9 +1133,7 @@ message CommitRequest { // Required. The session in which the transaction to be committed is running. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction in which to commit. @@ -1042,8 +1159,8 @@ message CommitRequest { repeated Mutation mutations = 4; // If `true`, then statistics related to the transaction will be included in - // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is - // `false`. + // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. + // Default value is `false`. bool return_commit_stats = 5; // Common options for this request. @@ -1055,9 +1172,7 @@ message RollbackRequest { // Required. The session in which the transaction to roll back is running. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction to roll back.