lib/google/cloud/spanner/v1/spanner_client.rb in google-cloud-spanner-1.8.0 vs lib/google/cloud/spanner/v1/spanner_client.rb in google-cloud-spanner-1.9.0

- old
+ new

@@ -242,10 +242,15 @@ @execute_streaming_sql = Google::Gax.create_api_call( @spanner_stub.method(:execute_streaming_sql), defaults["execute_streaming_sql"], exception_transformer: exception_transformer ) + @execute_batch_dml = Google::Gax.create_api_call( + @spanner_stub.method(:execute_batch_dml), + defaults["execute_batch_dml"], + exception_transformer: exception_transformer + ) @read = Google::Gax.create_api_call( @spanner_stub.method(:read), defaults["read"], exception_transformer: exception_transformer ) @@ -434,11 +439,13 @@ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Spanner::V1::ListSessionsRequest) @list_sessions.call(req, options, &block) end - # Ends a session, releasing server resources associated with it. + # Ends a session, releasing server resources associated with it. This will + # asynchronously trigger cancellation of any operations that are running with + # this session. # # @param name [String] # Required. The name of the session to delete. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, @@ -471,14 +478,16 @@ # if the query yields more data than that, the query fails with # a `FAILED_PRECONDITION` error. # # Operations inside read-write transactions might return `ABORTED`. If # this occurs, the application should restart the transaction from - # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more details. + # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more + # details. # # Larger result sets can be fetched in streaming fashion by calling - # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} instead. + # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} + # instead. # # @param session [String] # Required. The session in which the SQL query should be performed. # @param sql [String] # Required. The SQL string. @@ -516,29 +525,33 @@ # A hash of the same form as `Google::Protobuf::Struct` # can also be provided. # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}] # 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 {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # of type `STRING` both appear in + # {Google::Spanner::V1::ExecuteSqlRequest#params 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 # definition of {Google::Spanner::V1::Type Type} for more information # about SQL types. # A hash of the same form as `Google::Spanner::V1::Type` # can also be provided. # @param resume_token [String] # If this request is resuming a previously interrupted SQL statement # execution, `resume_token` should be copied from the last - # {Google::Spanner::V1::PartialResultSet 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. + # {Google::Spanner::V1::PartialResultSet 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. # @param query_mode [Google::Spanner::V1::ExecuteSqlRequest::QueryMode] # Used to control the amount of debugging information returned in - # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}. + # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If + # {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}. # @param partition_token [String] # If present, results will be restricted to the specified partition # previously created using PartitionQuery(). There must be an exact # match for the values of fields common to this message and the # PartitionQueryRequest message used to create this partition_token. @@ -596,15 +609,15 @@ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Spanner::V1::ExecuteSqlRequest) @execute_sql.call(req, options, &block) end - # Like {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, except returns the result - # set as a stream. Unlike {Google::Spanner::V1::Spanner::ExecuteSql 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 {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, except returns the + # result set as a stream. Unlike + # {Google::Spanner::V1::Spanner::ExecuteSql 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. # # @param session [String] # Required. The session in which the SQL query should be performed. # @param sql [String] # Required. The SQL string. @@ -642,29 +655,33 @@ # A hash of the same form as `Google::Protobuf::Struct` # can also be provided. # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}] # 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 {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # of type `STRING` both appear in + # {Google::Spanner::V1::ExecuteSqlRequest#params 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 # definition of {Google::Spanner::V1::Type Type} for more information # about SQL types. # A hash of the same form as `Google::Spanner::V1::Type` # can also be provided. # @param resume_token [String] # If this request is resuming a previously interrupted SQL statement # execution, `resume_token` should be copied from the last - # {Google::Spanner::V1::PartialResultSet 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. + # {Google::Spanner::V1::PartialResultSet 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. # @param query_mode [Google::Spanner::V1::ExecuteSqlRequest::QueryMode] # Used to control the amount of debugging information returned in - # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}. + # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If + # {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}. # @param partition_token [String] # If present, results will be restricted to the specified partition # previously created using PartitionQuery(). There must be an exact # match for the values of fields common to this message and the # PartitionQueryRequest message used to create this partition_token. @@ -722,41 +739,129 @@ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Spanner::V1::ExecuteSqlRequest) @execute_streaming_sql.call(req, options) end + # Executes a batch of SQL DML statements. This method allows many statements + # to be run with lower latency than submitting them sequentially with + # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}. + # + # Statements are executed in order, sequentially. + # {Spanner::ExecuteBatchDmlResponse ExecuteBatchDmlResponse} will contain a + # {Google::Spanner::V1::ResultSet ResultSet} for each DML statement that has successfully executed. If a + # statement fails, its error status will be returned as part of the + # {Spanner::ExecuteBatchDmlResponse ExecuteBatchDmlResponse}. Execution will + # stop at the first failed statement; the remaining statements will not run. + # + # ExecuteBatchDml is expected to return an OK status with a response even if + # there was an error while processing one of the DML statements. Clients must + # inspect response.status to determine if there were any errors while + # processing the request. + # + # See more details in + # {Spanner::ExecuteBatchDmlRequest ExecuteBatchDmlRequest} and + # {Spanner::ExecuteBatchDmlResponse ExecuteBatchDmlResponse}. + # + # @param session [String] + # Required. The session in which the DML statements should be performed. + # @param transaction [Google::Spanner::V1::TransactionSelector | Hash] + # The transaction to use. A ReadWrite transaction is required. Single-use + # transactions are not supported (to avoid replay). The caller must either + # supply an existing transaction ID or begin a new transaction. + # A hash of the same form as `Google::Spanner::V1::TransactionSelector` + # can also be provided. + # @param statements [Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement | Hash>] + # 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 will stop at the + # first failed statement; the remaining statements will not run. + # + # REQUIRES: statements_size() > 0. + # A hash of the same form as `Google::Spanner::V1::ExecuteBatchDmlRequest::Statement` + # can also be provided. + # @param seqno [Integer] + # A per-transaction sequence number used to identify this request. This is + # used in the same space as the seqno in + # {Spanner::ExecuteSqlRequest ExecuteSqlRequest}. See more details + # in {Spanner::ExecuteSqlRequest ExecuteSqlRequest}. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Spanner::V1::ExecuteBatchDmlResponse] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Spanner::V1::ExecuteBatchDmlResponse] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/cloud/spanner/v1" + # + # spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new + # formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]") + # + # # TODO: Initialize `transaction`: + # transaction = {} + # + # # TODO: Initialize `statements`: + # statements = [] + # + # # TODO: Initialize `seqno`: + # seqno = 0 + # response = spanner_client.execute_batch_dml(formatted_session, transaction, statements, seqno) + + def execute_batch_dml \ + session, + transaction, + statements, + seqno, + options: nil, + &block + req = { + session: session, + transaction: transaction, + statements: statements, + seqno: seqno + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Spanner::V1::ExecuteBatchDmlRequest) + @execute_batch_dml.call(req, options, &block) + end + # Reads rows from the database using key lookups and scans, as a # simple key/value style alternative to - # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}. This method cannot be used to - # return a result set larger than 10 MiB; if the read matches more + # {Google::Spanner::V1::Spanner::ExecuteSql 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 {Google::Spanner::V1::Transaction Transaction} for more details. + # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more + # details. # # Larger result sets can be yielded in streaming fashion by calling # {Google::Spanner::V1::Spanner::StreamingRead StreamingRead} instead. # # @param session [String] # Required. The session in which the read should be performed. # @param table [String] # Required. The name of the table in the database to be read. # @param columns [Array<String>] - # The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned for each row matching - # this request. + # The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned + # for each row matching this request. # @param key_set [Google::Spanner::V1::KeySet | Hash] # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to be yielded, unless {Google::Spanner::V1::ReadRequest#index index} - # is present. If {Google::Spanner::V1::ReadRequest#index index} is present, then {Google::Spanner::V1::ReadRequest#key_set key_set} instead names - # index keys in {Google::Spanner::V1::ReadRequest#index index}. + # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {Google::Spanner::V1::ReadRequest#index index} is present. + # If {Google::Spanner::V1::ReadRequest#index index} is present, then + # {Google::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {Google::Spanner::V1::ReadRequest#index index}. # - # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is empty, rows are yielded - # in table primary key order (if {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is not - # empty, rows will be yielded in an unspecified order. + # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {Google::Spanner::V1::ReadRequest#partition_token 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. # A hash of the same form as `Google::Spanner::V1::KeySet` # can also be provided. @@ -764,23 +869,26 @@ # The transaction to use. If none is provided, the default is a # temporary read-only transaction with strong concurrency. # A hash of the same form as `Google::Spanner::V1::TransactionSelector` # can also be provided. # @param index [String] - # If non-empty, the name of an index on {Google::Spanner::V1::ReadRequest#table table}. This index is - # used instead of the table primary key when interpreting {Google::Spanner::V1::ReadRequest#key_set key_set} - # and sorting result rows. See {Google::Spanner::V1::ReadRequest#key_set key_set} for further information. + # If non-empty, the name of an index on + # {Google::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {Google::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {Google::Spanner::V1::ReadRequest#key_set key_set} for further + # information. # @param limit [Integer] # If greater than zero, only the first `limit` rows are yielded. If `limit` # is zero, the default is no limit. A limit cannot be specified if # `partition_token` is set. # @param resume_token [String] # If this request is resuming a previously interrupted read, # `resume_token` should be copied from the last - # {Google::Spanner::V1::PartialResultSet 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 + # {Google::Spanner::V1::PartialResultSet 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. # @param partition_token [String] # If present, results will be restricted to the specified partition # previously created using PartitionRead(). There must be an exact # match for the values of fields common to this message and the @@ -834,33 +942,37 @@ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Spanner::V1::ReadRequest) @read.call(req, options, &block) end - # Like {Google::Spanner::V1::Spanner::Read Read}, except returns the result set as a - # stream. Unlike {Google::Spanner::V1::Spanner::Read Read}, there is no limit on the - # size of the returned result set. However, no individual row in + # Like {Google::Spanner::V1::Spanner::Read Read}, except returns the result set + # as a stream. Unlike {Google::Spanner::V1::Spanner::Read 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. # # @param session [String] # Required. The session in which the read should be performed. # @param table [String] # Required. The name of the table in the database to be read. # @param columns [Array<String>] - # The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned for each row matching - # this request. + # The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned + # for each row matching this request. # @param key_set [Google::Spanner::V1::KeySet | Hash] # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to be yielded, unless {Google::Spanner::V1::ReadRequest#index index} - # is present. If {Google::Spanner::V1::ReadRequest#index index} is present, then {Google::Spanner::V1::ReadRequest#key_set key_set} instead names - # index keys in {Google::Spanner::V1::ReadRequest#index index}. + # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {Google::Spanner::V1::ReadRequest#index index} is present. + # If {Google::Spanner::V1::ReadRequest#index index} is present, then + # {Google::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {Google::Spanner::V1::ReadRequest#index index}. # - # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is empty, rows are yielded - # in table primary key order (if {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is not - # empty, rows will be yielded in an unspecified order. + # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {Google::Spanner::V1::ReadRequest#partition_token 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. # A hash of the same form as `Google::Spanner::V1::KeySet` # can also be provided. @@ -868,23 +980,26 @@ # The transaction to use. If none is provided, the default is a # temporary read-only transaction with strong concurrency. # A hash of the same form as `Google::Spanner::V1::TransactionSelector` # can also be provided. # @param index [String] - # If non-empty, the name of an index on {Google::Spanner::V1::ReadRequest#table table}. This index is - # used instead of the table primary key when interpreting {Google::Spanner::V1::ReadRequest#key_set key_set} - # and sorting result rows. See {Google::Spanner::V1::ReadRequest#key_set key_set} for further information. + # If non-empty, the name of an index on + # {Google::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {Google::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {Google::Spanner::V1::ReadRequest#key_set key_set} for further + # information. # @param limit [Integer] # If greater than zero, only the first `limit` rows are yielded. If `limit` # is zero, the default is no limit. A limit cannot be specified if # `partition_token` is set. # @param resume_token [String] # If this request is resuming a previously interrupted read, # `resume_token` should be copied from the last - # {Google::Spanner::V1::PartialResultSet 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 + # {Google::Spanner::V1::PartialResultSet 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. # @param partition_token [String] # If present, results will be restricted to the specified partition # previously created using PartitionRead(). There must be an exact # match for the values of fields common to this message and the @@ -939,11 +1054,12 @@ req = Google::Gax::to_proto(req, Google::Spanner::V1::ReadRequest) @streaming_read.call(req, options) end # Begins a new transaction. This step can often be skipped: - # {Google::Spanner::V1::Spanner::Read Read}, {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} and + # {Google::Spanner::V1::Spanner::Read Read}, + # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} and # {Google::Spanner::V1::Spanner::Commit Commit} can begin a new transaction as a # side-effect. # # @param session [String] # Required. The session in which the transaction runs. @@ -1048,12 +1164,13 @@ @commit.call(req, options, &block) end # 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 - # {Google::Spanner::V1::Spanner::Read Read} or {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} requests and - # ultimately decides not to commit. + # {Google::Spanner::V1::Spanner::Read Read} or + # {Google::Spanner::V1::Spanner::ExecuteSql 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 # found. `Rollback` never returns `ABORTED`. # @@ -1092,14 +1209,15 @@ nil end # 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 {Google::Spanner::V1::Spanner::ExecuteStreamingSql 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 {Google::Spanner::V1::Spanner::ExecuteStreamingSql 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 # old. When any of these happen, it is not possible to resume the query, and # the whole operation must be restarted from the beginning. @@ -1113,11 +1231,12 @@ # union operator conceptually divides one or more tables into multiple # splits, remotely evaluates a subquery independently on each split, and # then unions all results. # # This must not contain DML commands, such as INSERT, UPDATE, or - # DELETE. Use {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} with a + # DELETE. Use + # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} with a # PartitionedDml transaction for large, partition-friendly DML operations. # @param transaction [Google::Spanner::V1::TransactionSelector | Hash] # Read only snapshot transactions are supported, read/write and single use # transactions are not. # A hash of the same form as `Google::Spanner::V1::TransactionSelector` @@ -1140,11 +1259,12 @@ # A hash of the same form as `Google::Protobuf::Struct` # can also be provided. # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}] # 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 {Google::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. + # of type `STRING` both appear in + # {Google::Spanner::V1::PartitionQueryRequest#params 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 # definition of {Google::Spanner::V1::Type Type} for more information # about SQL types. @@ -1193,16 +1313,17 @@ @partition_query.call(req, options, &block) end # 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 {Google::Spanner::V1::Spanner::StreamingRead 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 {Google::Spanner::V1::Spanner::StreamingRead 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 # old. When any of these happen, it is not possible to resume the read, and # the whole operation must be restarted from the beginning. @@ -1211,12 +1332,15 @@ # Required. The session used to create the partitions. # @param table [String] # Required. The name of the table in the database to be read. # @param key_set [Google::Spanner::V1::KeySet | Hash] # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {Google::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless {Google::Spanner::V1::PartitionReadRequest#index index} - # is present. If {Google::Spanner::V1::PartitionReadRequest#index index} is present, then {Google::Spanner::V1::PartitionReadRequest#key_set key_set} instead names + # primary keys of the rows in + # {Google::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless + # {Google::Spanner::V1::PartitionReadRequest#index index} is present. If + # {Google::Spanner::V1::PartitionReadRequest#index index} is present, then + # {Google::Spanner::V1::PartitionReadRequest#key_set key_set} instead names # index keys in {Google::Spanner::V1::PartitionReadRequest#index index}. # # 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. # A hash of the same form as `Google::Spanner::V1::KeySet` @@ -1225,15 +1349,18 @@ # Read only snapshot transactions are supported, read/write and single use # transactions are not. # A hash of the same form as `Google::Spanner::V1::TransactionSelector` # can also be provided. # @param index [String] - # If non-empty, the name of an index on {Google::Spanner::V1::PartitionReadRequest#table table}. This index is - # used instead of the table primary key when interpreting {Google::Spanner::V1::PartitionReadRequest#key_set key_set} - # and sorting result rows. See {Google::Spanner::V1::PartitionReadRequest#key_set key_set} for further information. + # If non-empty, the name of an index on + # {Google::Spanner::V1::PartitionReadRequest#table table}. This index is used + # instead of the table primary key when interpreting + # {Google::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting + # result rows. See {Google::Spanner::V1::PartitionReadRequest#key_set key_set} + # for further information. # @param columns [Array<String>] - # The columns of {Google::Spanner::V1::PartitionReadRequest#table table} to be returned for each row matching - # this request. + # The columns of {Google::Spanner::V1::PartitionReadRequest#table table} to be + # returned for each row matching this request. # @param partition_options [Google::Spanner::V1::PartitionOptions | Hash] # Additional options that affect how many partitions are created. # A hash of the same form as `Google::Spanner::V1::PartitionOptions` # can also be provided. # @param options [Google::Gax::CallOptions]