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

Conversation

ajkerrigan
Copy link
Collaborator

@ajkerrigan ajkerrigan commented Jul 20, 2023

ibis 6 moved away from the clickhouse-driver project in favor of clickhouse-connect. The latter client does not provide an execute_iter method, though it does provide a row-based stream method which seems to address the same general use case.

I wouldn't say I'm confident this is the right solution to #1953 - it still may need some fine-tuning but it sounds like a reasonable start. More productive than a shrug at least 😆 . Thanks to @cpcloud for providing helpful context around the underlying ibis changes.

ibis 6 moved away from the clickhouse-driver project in favor of
clickhouse-connect. The latter client does not provide an `execute_iter`
method, though it _does_ provide a row-based stream which seems to
address the same general use case.
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"
}

@anjakefala anjakefala merged commit e208ca4 into saulpw:develop Jul 31, 2023
13 checks passed
@anjakefala
Copy link
Collaborator

Thanks so much for looking into this @ajkerrigan! And to @cpcloud for explaining the problem. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants