You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
@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:
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:
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)
The text was updated successfully, but these errors were encountered: