Skip to content

Commit 3781626

Browse files
Keep track of progress through current batch of rows.
1 parent 36247d1 commit 3781626

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

presto/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,9 @@ def __init__(
449449
self._request = request
450450
self._sql = sql
451451

452-
self._rows = []
453452
self._rownumber = 0
453+
self._rows = []
454+
self._rowsoffset = 0
454455

455456
@property
456457
def columns(self):
@@ -530,9 +531,11 @@ def is_finished(self):
530531

531532
def __iter__(self):
532533
while self._rows or not self.is_finished():
533-
for row in self._rows:
534+
for row in self._rows[self._rowsoffset:]:
534535
self._rownumber += 1
536+
self._rowsoffset +=1
535537
logger.debug('row {}'.format(row))
536538
yield row
537539
self._rows = []
540+
self._rowsoffset = 0
538541
self.poll()

0 commit comments

Comments
 (0)