lib/google/cloud/spanner/v1/spanner_client.rb in google-cloud-spanner-1.14.0 vs lib/google/cloud/spanner/v1/spanner_client.rb in google-cloud-spanner-1.15.0

- old
+ new

@@ -187,10 +187,13 @@ google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" google_api_client << " grpc/#{GRPC::VERSION}" google_api_client.freeze headers = { :"x-goog-api-client" => google_api_client } + if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id + headers[:"x-goog-user-project"] = credentials.quota_project_id + end headers.merge!(metadata) unless metadata.nil? client_config_file = Pathname.new(__dir__).join( "spanner_client_config.json" ) defaults = client_config_file.open do |f| @@ -356,11 +359,11 @@ # transaction internally, and count toward the one transaction # limit. # # Active sessions use additional server resources, so it is a good idea to # delete idle and unneeded sessions. - # Aside from explicit deletes, Cloud Spanner can delete sessions for which no + # Aside from explicit deletes, Cloud Spanner may delete sessions for which no # operations are sent for more than an hour. If a session is deleted, # requests to it return `NOT_FOUND`. # # Idle sessions can be kept alive by sending a trivial SQL query # periodically, e.g., `"SELECT 1"`. @@ -409,12 +412,11 @@ # @param session_count [Integer] # Required. The number of sessions to be created in this batch call. # 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 - # {Google::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} - # as necessary). + # {Google::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} as necessary). # @param session_template [Google::Spanner::V1::Session | Hash] # Parameters to be applied to each created session. # A hash of the same form as `Google::Spanner::V1::Session` # can also be provided. # @param options [Google::Gax::CallOptions] @@ -586,16 +588,14 @@ # 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. @@ -628,33 +628,29 @@ # 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. @@ -667,10 +663,14 @@ # transaction. If a request arrives for the first time with an out-of-order # sequence number, the transaction may be aborted. Replays of previously # handled requests will yield the same response as the first execution. # # Required for DML statements. Ignored for queries. + # @param query_options [Google::Spanner::V1::ExecuteSqlRequest::QueryOptions | Hash] + # Query optimizer configuration to use for the given query. + # A hash of the same form as `Google::Spanner::V1::ExecuteSqlRequest::QueryOptions` + # can also be provided. # @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::ResultSet] @@ -695,10 +695,11 @@ param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, + query_options: nil, options: nil, &block req = { session: session, sql: sql, @@ -706,21 +707,22 @@ params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, - seqno: seqno + seqno: seqno, + query_options: query_options }.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. @@ -753,33 +755,29 @@ # 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. @@ -792,10 +790,14 @@ # transaction. If a request arrives for the first time with an out-of-order # sequence number, the transaction may be aborted. Replays of previously # handled requests will yield the same response as the first execution. # # Required for DML statements. Ignored for queries. + # @param query_options [Google::Spanner::V1::ExecuteSqlRequest::QueryOptions | Hash] + # Query optimizer configuration to use for the given query. + # A hash of the same form as `Google::Spanner::V1::ExecuteSqlRequest::QueryOptions` + # can also be provided. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @return [Enumerable<Google::Spanner::V1::PartialResultSet>] # An enumerable of Google::Spanner::V1::PartialResultSet instances. @@ -821,35 +823,36 @@ param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, + query_options: nil, options: nil req = { session: session, sql: sql, transaction: transaction, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, - seqno: seqno + seqno: seqno, + query_options: query_options }.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 sequential order. A request can succeed even if - # a statement fails. The - # {Google::Spanner::V1::ExecuteBatchDmlResponse#status 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 {Google::Spanner::V1::ExecuteBatchDmlResponse#status 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. # # @param session [String] @@ -861,22 +864,22 @@ # 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>] - # 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. # A hash of the same form as `Google::Spanner::V1::ExecuteBatchDmlRequest::Statement` # can also be provided. # @param seqno [Integer] - # 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 # sequence number, the transaction may be aborted. Replays of previously # handled requests will yield the same response as the first execution. @@ -921,44 +924,39 @@ @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>] - # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. + # Required. 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. @@ -966,26 +964,23 @@ # 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 @@ -1039,37 +1034,33 @@ }.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>] - # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. + # Required. 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. @@ -1077,26 +1068,23 @@ # 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 @@ -1151,12 +1139,11 @@ 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. @@ -1261,13 +1248,12 @@ @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`. # @@ -1306,34 +1292,32 @@ 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. # # @param session [String] # Required. The session used to create the partitions. # @param sql [String] - # 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 + # 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. # # 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` @@ -1354,12 +1338,11 @@ # 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. @@ -1408,17 +1391,16 @@ @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. @@ -1427,15 +1409,12 @@ # 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` @@ -1444,18 +1423,15 @@ # 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]