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
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
I tried to use multiprocessing instead but can't make it work and I am not even sure this is possible.
I first tried to replace the doc example ThreadPoolExecutor with ProcessPoolExecutor. It hangs forever so I guess the snapshot object can't be shared between multi processes.
I also tried to recreate the session but a partition is only valid within the same session according to the error: details = "Partitioned request was created for a different session."
Here is the code of the latter approach (recreating the session):
Is there is a way to dispatch batched results to multiple processes in Python for high-performance reading? I guess each partition hash should be able to live outside of a snapshot object on the Spanner side. I am not sure this is possible.
The example from the doc https://cloud.google.com/spanner/docs/reads#read_data_in_parallel works well with multi-threading. That being said in Python I found the performance to be equivalent to without using multithreading (probably because of the GIL).
I tried to use multiprocessing instead but can't make it work and I am not even sure this is possible.
ThreadPoolExecutorwithProcessPoolExecutor. It hangs forever so I guess thesnapshotobject can't be shared between multi processes.details = "Partitioned request was created for a different session."Here is the code of the latter approach (recreating the session):
Is there is a way to dispatch batched results to multiple processes in Python for high-performance reading? I guess each partition hash should be able to live outside of a snapshot object on the Spanner side. I am not sure this is possible.