For some reasons user may want to retrieve large amount of data from the table. Now it is possible only through the online read only transaction and it leads to TruncatedResponseError. Moreover such approach affects OLTP queries.
The YDB has special mechanism to do OLAP queries using snapshots called ScanQuery.
In this PR
In this PR I add an execution option to enable ScanQuery mode.
Example
with engine.begin() as connection:
connection.execution_options(ydb_scan_query=True) # Enable ScanQuery mode on connection
cursor = connection.execute(sa.select(table)) # Fetch rows using ScanQuery
for chunk in cursor.partitions(1000): # gRPC stream iteration supported
print(chunk)
Problem
For some reasons user may want to retrieve large amount of data from the table. Now it is possible only through the online read only transaction and it leads to TruncatedResponseError. Moreover such approach affects OLTP queries.
The YDB has special mechanism to do OLAP queries using snapshots called ScanQuery.
In this PR
In this PR I add an execution option to enable ScanQuery mode.
Example