StreamedResultSet API

Wrapper for streaming results.

class google.cloud.spanner_v1.streamed.StreamedResultSet(response_iterator, source=None)

Bases: object

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

  • Parameters

    • response_iterator – Iterator yielding PartialResultSet instances.

    • source (Snapshot) – Snapshot from which the result set was fetched.

property fields()

Field descriptors for result set columns.

  • Return type

    list of Field

  • Returns

    list of fields describing column names / types.

property metadata()

Result set metadata

one()

Return exactly one result, or raise an exception.

  • Raises

    NotFound: If there are no results.

  • Raises

    ValueError: If there are multiple results.

  • Raises

    RuntimeError: If consumption has already occurred, in whole or in part.

one_or_none()

Return exactly one result, or None if there are no results.

  • Raises

    ValueError: If there are multiple results.

  • Raises

    RuntimeError: If consumption has already occurred, in whole or in part.

property stats()

Result set statistics

  • Return type

    ResultSetStats

  • Returns

    structure describing status about the response

exception google.cloud.spanner_v1.streamed.Unmergeable(lhs, rhs, type_)

Bases: ValueError

Unable to merge two values.

  • Parameters

    • lhs (Value) – pending value to be merged

    • rhs (Value) – remaining value to be merged

    • type (Type) – field type of values being merged

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月16日 UTC.