Skip to content

Commit

Permalink
Merge pull request #1966 from ajkerrigan/ajk/1953-clickhouse-row-iter…
Browse files Browse the repository at this point in the history
…ation

[vdsql] replace execute_iter for clickhouse/ibis 6 compatibility
  • Loading branch information
anjakefala committed Jul 31, 2023
2 parents 3c1e650 + 13c420c commit e208ca4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions visidata/apps/vdsql/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def iterload(self):

with Progress(gerund='clickhousing', sheet=self) as prog:
settings = {'max_block_size': 10000}
self.query_result = con.con.execute_iter(sqlstr, settings, chunk_size=1000, query_id=qid)
qid = str(time.time())
for row in self.query_result:
prog.total = con.con.last_query.progress.total_rows
prog.made = con.con.last_query.progress.rows
with con.con.query_rows_stream(sqlstr, settings) as stream:
prog.total = int(stream.source.summary['total_rows_to_read'])
prog.made = 0
for row in stream:
prog.made += 1
yield row
self.total_rows = prog.total
yield from row

except Exception as e:
raise
Expand Down

0 comments on commit e208ca4

Please sign in to comment.