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

Fix parameter binding for arrow results #4229

Closed
wants to merge 1 commit into from

Conversation

nbenn
Copy link
Contributor

@nbenn nbenn commented Jul 27, 2022

Ad #4219

@Mytherin
Copy link
Collaborator

@krlmlr could you perhaps have a look?

@Mytherin Mytherin requested a review from krlmlr July 28, 2022 19:56
@hannes
Copy link
Member

hannes commented Jul 30, 2022

Why can't we just use res@query_result in all cases?

@krlmlr
Copy link
Collaborator

krlmlr commented Jul 30, 2022

Or should we get rid of the "query_result" slot and use env$query_result consistently? It feels weird to have this general-purpose env sitting there, and then the super-strict "query_result" S4 slot.

I also wonder if we also/instead need to special-case for Arrow in dbBind__duckdb_result() .

I agree that we want to get that right independently of r-dbi/DBI#390.

@nbenn
Copy link
Contributor Author

nbenn commented Jul 30, 2022

The proposed fix is not the most elegant, I agree. I went with more of a "quick fix" approach rather than changing the logic in multiple places. We might be changing some of this again when the DBI interface extension for arrow becomes available.

Why can't we just use res@query_result in all cases?

While dbBind() does return the result object, it does so invisibly and in doing so it might be called only for its side effect. Therefore I used the already available env slot for its reference semantics.

Or should we get rid of the "query_result" slot and use env$query_result consistently?

Sure, we could do that. This would entail a bit of a rewrite, which is why I did not go directly for this.

I also wonder if we also/instead need to special-case for Arrow in dbBind__duckdb_result()

@krlmlr could you elaborate? I don't understand what you mean exactly.

@krlmlr
Copy link
Collaborator

krlmlr commented Sep 29, 2022

I took another look. It appears to me that we need to change too much here to make it work, and then we would be deprecating this functionality right away with the new DBI Arrow interface. What do you think?

@hannes hannes closed this Nov 14, 2022
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

4 participants