Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vdsql] replace execute_iter for clickhouse/ibis 6 compatibility #1966

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context, if I look at stream.source.summary when we enter this block after opening the benchmark_results table it looks like this:

{
    "read_rows": "16384",
    "read_bytes": "360448",
    "written_rows": "0",
    "written_bytes": "0",
    "total_rows_to_read": "500",
    "result_rows": "0",
    "result_bytes": "0",
    "query_id": "c413bc6a-5bd7-40a5-81bc-a64ef53dc9c8"
}

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
Loading