-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[C-API] Add support for StreamQueryResult #6318
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
Conversation
Writing the description, I had a thought, we could also support creating a regular (Materialized) result out of the pending query, then we'll just get the result and call Materialize on it. EDIT: duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result); Now also supports a streaming result, it just instantly calls Materialize on it. Maybe we also want to have a |
I wonder if these failures are related to my changes or just spurious |
The WebAssembly one has been borked since yesterday, @carlopi is on it. The other does not seem related either |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good - one minor comment.
Thanks! |
This PR adds a couple methods to the C-API to create and consume a stream query result.
The
pending
family of functions has a new addition:This creates a
duckdb_pending_result
, like before, the pending query result can be partially executed withduckdb_pending_execute_task
.The only difference is that to execute the pending query and turn it into a streaming query result, the following function needs to be called.
Similar to
duckdb_execute_pending
this creates a result object out of the pending query result.(also note that this pending query result can not be turned into a regular result)To interact with the result, most of the materialized-result family of functions can be used, with the exception of the chunk/row related functions.
To get a chunk out of the stream query result, instead you have to use: