GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Decode metadata and values of PartialResultSet · Issue #1316 · googleapis/python-spanner

This repository was archived by the owner on Jun 8, 2026. It is now read-only.
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Decode metadata and values of PartialResultSet #1316

Copy link
Copy link
Closed
Closed
Decode metadata and values of PartialResultSet#1316
Copy link
Assignees
bhatt4982
Labels
api: spannerIssues related to the googleapis/python-spanner API.

Description

@xxntti3n
xxntti3n
opened on Mar 2, 2025
Issue body actions

Hello everyone,
I am reading the change stream from Spanner using the Spanner client. I attempted to use StreamedResultSet, but I'm having trouble resolving it. Could someone please help me with mapping the metadata and values from the results when I run execute_streaming_sql? Thank you!
request = spanner_v1.ExecuteSqlRequest( session=session.name, sql=f"SELECT * FROM READ_spanner_all_change_stream( start_timestamp => '{current_time}', end_timestamp => NULL, partition_token => NULL, heartbeat_milliseconds => 10000)", ) result_set = spanner_client.execute_streaming_sql(request=request)

Activity

  1. product-auto-label
    added
    api: spannerIssues related to the googleapis/python-spanner API.
    on Mar 2, 2025
  2. blunderbuss-gcf
    assigned
    bhatt4982
    on Mar 2, 2025
  3. olavloite commented on Apr 3, 2025

    @olavloite
    olavloite
    on Apr 3, 2025
    Contributor
    More actions

    @xxntti3n It is highly recommended that you just use the standard query functions in the client library. These already use the execute_streaming_sql RPC under the hood and hide the details of mapping the returned PartialResultSets and metadata into easy-to-consume objects. So just follow this example:

    python-spanner/samples/samples/snippets.py

    Line 661 in b3c259d

    with database.snapshot() as snapshot:

    Note that if you specifically want to access the underlying protobuf values instead of having them converted to Python types, then you can set the lazy_decoding argument like this:

      with database.snapshot() as snapshot:
          results = snapshot.execute_sql(
              "SELECT SingerId, AlbumId, AlbumTitle FROM Albums",
              lazy_decode=True
          )
    
  4. olavloite
    closed this as completedon Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @bhatt4982
    bhatt4982

Labels

api: spannerIssues related to the googleapis/python-spanner API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.