StreamedResultSet API#

Wrapper for streaming results.

class google.cloud.spanner.streamed.StreamedResultSet(response_iterator)[source]#

Bases: object

Process a sequence of partial result sets into a single set of row data.

Parameters:response_iterator – Iterator yielding google.cloud.proto.spanner.v1.result_set_pb2.PartialResultSet instances.
consume_all()[source]#

Consume the streamed responses until there are no more.

consume_next()[source]#

Consume the next partial result set from the stream.

Parse the result set into new/existing rows in _rows

fields#

Field descriptors for result set columns.

Return type:list of Field
Returns:list of fields describing column names / types.
metadata#

Result set metadata

Return type:ResultSetMetadata
Returns:structure describing the results
resume_token#

Token for resuming interrupted read / query.

Return type:bytes
Returns:token from last chunk of results.
rows#

Fully-processed rows.

Return type:list of row-data lists.
Returns:list of completed row data, from proceesd PRS responses.
stats#

Result set statistics

Return type:ResultSetStats
Returns:structure describing status about the response
exception google.cloud.spanner.streamed.Unmergeable(lhs, rhs, type_)[source]#

Bases: exceptions.ValueError

Unable to merge two values.

Parameters:
  • lhs (google.protobuf.struct_pb2.Value) – pending value to be merged
  • rhs (google.protobuf.struct_pb2.Value) – remaining value to be merged
  • type (google.cloud.proto.spanner.v1.type_pb2.Type) – field type of values being merged