BradRuderman/pyhs2 — pull request #17 by gene-peters (2014-06-10 18:41:30+00:00)
Title: Adding "Streaming" cursor functionality

When pulling result rows from Thrift, the current cursor attempts to load them all into a single variable which it then returns. This can cause major issues with large result sets; I've implemented a cursor class which returns a generator object and iterates over each result row.

Example usage:

from cursor import SSCursor

conn = pyhs2.connect(cursor=SSCursor, **kwargs)
cur = conn.cursor()
cur.execute("SELECT * FROM table LIMIT 100")
for result in cur.fetch():
...print result