public sealed class PartialResultSet : IMessage<PartialResultSet>, IEquatable<PartialResultSet>, IDeepCloneable<PartialResultSet>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class PartialResultSet.
Partial results from a streaming read or SQL query. Streaming reads and
SQL queries better tolerate large result sets, large rows, and large
values, but are a little trickier to consume.
If true, then the final value in
[values][google.spanner.v1.PartialResultSet.values] is chunked, and must be
combined with more values from subsequent PartialResultSets to obtain a
complete field value.
Optional. Indicates whether this is the last PartialResultSet in the
stream. The server might optionally set this field. Clients shouldn't rely
on this field being set in all cases.
public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }
Optional. A precommit token is included if the read-write transaction
has multiplexed sessions enabled. Pass the precommit token with the highest
sequence number from this transaction attempt to the
[Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
Streaming calls might be interrupted for a variety of reasons, such
as TCP connection loss. If this occurs, the stream of results can
be resumed by re-sending the original request and including
resume_token. Note that executing any other transaction in the
same session invalidates the token.
Query plan and execution statistics for the statement that produced this
streaming result set. These can be requested by setting
[ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]
and are sent only once with the last response in the stream. This field is
also present in the last response for DML statements.
A streamed result set consists of a stream of values, which might
be split into many PartialResultSet messages to accommodate
large rows and/or large values. Every N complete values defines a
row, where N is equal to the number of entries in
[metadata.row_type.fields][google.spanner.v1.StructType.fields].
Most values are encoded based on type as described
[here][google.spanner.v1.TypeCode].
It's possible that the last value in values is "chunked",
meaning that the rest of the value is sent in subsequent
PartialResultSet(s). This is denoted by the
[chunked_value][google.spanner.v1.PartialResultSet.chunked_value] field.
Two or more chunked values can be merged to form a complete value as
follows:
bool/number/null: can't be chunked
string: concatenate the strings
list: concatenate the lists. If the last element in a list is a
string, list, or object, merge it with the first element in
the next list by applying these rules recursively.
object: concatenate the (field name, field value) pairs. If a
field name is duplicated, then apply these rules recursively
to merge the field values.
Some examples of merging:
Strings are concatenated.
"foo", "bar" => "foobar"
Lists of non-strings are concatenated.
[2, 3], [4] => [2, 3, 4]
Lists are concatenated, but the last and first elements are merged
because they are strings.
["a", "b"], ["c", "d"] => ["a", "bc", "d"]
Lists are concatenated, but the last and first elements are merged
because they are lists. Recursively, the last and first elements
of the inner lists are merged because they are strings.
["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"]
Non-overlapping object fields are combined.
{"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"}
Overlapping object fields are merged.
{"a": "1"}, {"a": "2"} => {"a": "12"}
Examples of merging objects containing lists of strings.
{"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]}
For a more complete example, suppose a streaming SQL query is
yielding a result set whose rows contain a single string
field. The following PartialResultSets might be yielded:
This sequence of PartialResultSets encodes two rows, one
containing the field value "Hello", and a second containing the
field value "World" = "W" + "orl" + "d".
Not all PartialResultSets contain a resume_token. Execution can only be
resumed from a previously yielded resume_token. For the above sequence of
PartialResultSets, resuming the query with "resume_token": "Af65..."
yields results from the PartialResultSet with value "orl".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis documentation details the \u003ccode\u003ePartialResultSet\u003c/code\u003e class, a component of the Google Cloud Spanner v1 API used for streaming read or SQL query results.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePartialResultSet\u003c/code\u003e class is designed to handle large result sets, rows, and values by potentially splitting data across multiple messages, as indicated by the \u003ccode\u003echunked_value\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes details about properties such as \u003ccode\u003eMetadata\u003c/code\u003e, \u003ccode\u003eResumeToken\u003c/code\u003e, and \u003ccode\u003eValues\u003c/code\u003e, which manage aspects of the result set's structure, resumption, and content.\u003c/p\u003e\n"],["\u003cp\u003eMultiple versions of the \u003ccode\u003ePartialResultSet\u003c/code\u003e class are available, ranging from version 3.5.0 to the latest beta version 5.0.0-beta05.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePartialResultSet\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing a structure to the class and giving it the properties of each of the interfaces it implements.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class PartialResultSet (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.PartialResultSet)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.PartialResultSet)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.PartialResultSet) \n\n public sealed class PartialResultSet : IMessage\u003cPartialResultSet\u003e, IEquatable\u003cPartialResultSet\u003e, IDeepCloneable\u003cPartialResultSet\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class PartialResultSet.\n\nPartial results from a streaming read or SQL query. Streaming reads and\nSQL queries better tolerate large result sets, large rows, and large\nvalues, but are a little trickier to consume. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PartialResultSet \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PartialResultSet](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.PartialResultSet), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PartialResultSet](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.PartialResultSet), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PartialResultSet](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.PartialResultSet), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nConstructors\n------------\n\n### PartialResultSet()\n\n public PartialResultSet()\n\n### PartialResultSet(PartialResultSet)\n\n public PartialResultSet(PartialResultSet other)\n\nProperties\n----------\n\n### ChunkedValue\n\n public bool ChunkedValue { get; set; }\n\nIf true, then the final value in\n\\[values\\]\\[google.spanner.v1.PartialResultSet.values\\] is chunked, and must be\ncombined with more values from subsequent `PartialResultSet`s to obtain a\ncomplete field value.\n\n### Last\n\n public bool Last { get; set; }\n\nOptional. Indicates whether this is the last `PartialResultSet` in the\nstream. The server might optionally set this field. Clients shouldn't rely\non this field being set in all cases.\n\n### Metadata\n\n public ResultSetMetadata Metadata { get; set; }\n\nMetadata about the result set, such as row type information.\nOnly present in the first response.\n\n### PrecommitToken\n\n public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }\n\nOptional. A precommit token is included if the read-write transaction\nhas multiplexed sessions enabled. Pass the precommit token with the highest\nsequence number from this transaction attempt to the\n\\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\] request for this transaction.\n\n### ResumeToken\n\n public ByteString ResumeToken { get; set; }\n\nStreaming calls might be interrupted for a variety of reasons, such\nas TCP connection loss. If this occurs, the stream of results can\nbe resumed by re-sending the original request and including\n`resume_token`. Note that executing any other transaction in the\nsame session invalidates the token.\n\n### Stats\n\n public ResultSetStats Stats { get; set; }\n\nQuery plan and execution statistics for the statement that produced this\nstreaming result set. These can be requested by setting\n\\[ExecuteSqlRequest.query_mode\\]\\[google.spanner.v1.ExecuteSqlRequest.query_mode\\]\nand are sent only once with the last response in the stream. This field is\nalso present in the last response for DML statements.\n\n### Values\n\n public RepeatedField\u003cValue\u003e Values { get; }\n\nA streamed result set consists of a stream of values, which might\nbe split into many `PartialResultSet` messages to accommodate\nlarge rows and/or large values. Every N complete values defines a\nrow, where N is equal to the number of entries in\n\\[metadata.row_type.fields\\]\\[google.spanner.v1.StructType.fields\\].\n\nMost values are encoded based on type as described\n\\[here\\]\\[google.spanner.v1.TypeCode\\].\n\nIt's possible that the last value in values is \"chunked\",\nmeaning that the rest of the value is sent in subsequent\n`PartialResultSet`(s). This is denoted by the\n\\[chunked_value\\]\\[google.spanner.v1.PartialResultSet.chunked_value\\] field.\nTwo or more chunked values can be merged to form a complete value as\nfollows:\n\n- `bool/number/null`: can't be chunked\n- `string`: concatenate the strings\n- `list`: concatenate the lists. If the last element in a list is a `string`, `list`, or `object`, merge it with the first element in the next list by applying these rules recursively.\n- `object`: concatenate the (field name, field value) pairs. If a field name is duplicated, then apply these rules recursively to merge the field values.\n\nSome examples of merging: \n\n Strings are concatenated.\n \"foo\", \"bar\" =\u003e \"foobar\"\n\n Lists of non-strings are concatenated.\n [2, 3], [4] =\u003e [2, 3, 4]\n\n Lists are concatenated, but the last and first elements are merged\n because they are strings.\n [\"a\", \"b\"], [\"c\", \"d\"] =\u003e [\"a\", \"bc\", \"d\"]\n\n Lists are concatenated, but the last and first elements are merged\n because they are lists. Recursively, the last and first elements\n of the inner lists are merged because they are strings.\n [\"a\", [\"b\", \"c\"]], [[\"d\"], \"e\"] =\u003e [\"a\", [\"b\", \"cd\"], \"e\"]\n\n Non-overlapping object fields are combined.\n {\"a\": \"1\"}, {\"b\": \"2\"} =\u003e {\"a\": \"1\", \"b\": 2\"}\n\n Overlapping object fields are merged.\n {\"a\": \"1\"}, {\"a\": \"2\"} =\u003e {\"a\": \"12\"}\n\n Examples of merging objects containing lists of strings.\n {\"a\": [\"1\"]}, {\"a\": [\"2\"]} =\u003e {\"a\": [\"12\"]}\n\nFor a more complete example, suppose a streaming SQL query is\nyielding a result set whose rows contain a single string\nfield. The following `PartialResultSet`s might be yielded: \n\n {\n \"metadata\": { ... }\n \"values\": [\"Hello\", \"W\"]\n \"chunked_value\": true\n \"resume_token\": \"Af65...\"\n }\n {\n \"values\": [\"orl\"]\n \"chunked_value\": true\n }\n {\n \"values\": [\"d\"]\n \"resume_token\": \"Zx1B...\"\n }\n\nThis sequence of `PartialResultSet`s encodes two rows, one\ncontaining the field value `\"Hello\"`, and a second containing the\nfield value `\"World\" = \"W\" + \"orl\" + \"d\"`.\n\nNot all `PartialResultSet`s contain a `resume_token`. Execution can only be\nresumed from a previously yielded `resume_token`. For the above sequence of\n`PartialResultSet`s, resuming the query with `\"resume_token\": \"Af65...\"`\nyields results from the `PartialResultSet` with value \"orl\"."]]