-
Notifications
You must be signed in to change notification settings - Fork 139
Running a chain of statements that depend on each other #74
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
Comments
Do you know how this chain is being executed by the underlying DB-API?
I recall that BigQuery didn't support scripting when I first implemented
the DB-API connector. Perhaps this would be fixed by changing the
executemany() function to issue the statements in one batch?
…On Fri, Nov 6, 2020, 9:30 PM Maxime Beauchemin ***@***.***> wrote:
[image: Screen Shot 2020-11-06 at 7 28 37 PM]
<https://user-images.githubusercontent.com/487433/98430957-5503d680-2066-11eb-9583-7775aa2490fd.png>
I'm having an issue running a chain of statements that depend on each
other in a common session. I'm using a single connection and cursor behind
the scene.
It appears that the statements are not chained and the session isn't
persisted. Any clue on how to solve this?
Other DBAPI implementations allow this type of chaining, and using the
same logic with this driver does not work properly.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#74>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB4OA2OYVXJMJOMZYIWV7LSOS5PFANCNFSM4TNMHVJQ>
.
|
I'm not sure if you're asking about how we run it, or how the underlying DB-API in
Now I'm realizing the issue may be in |
Yes, https://github.com/googleapis/python-bigquery would be the appropriate location for this issue. Are you calling If once per statement, are there any transaction semantics you're using? The BigQuery API doesn't hold onto cursor/connection state, so we'll need some kind of additional information in order for the client to batch these up into a single request. |
We're calling execute for each statement, most other DB-API driver's
Wondering what that may be. I saw the notion of |
I opened an issue on |
Updating this issue from our discussion on the DB-API. Currently we workaround this by batching all statements in to a single query request. This triggers the BigQuery "scripting" path. The ideal solution is for the BigQuery backend to support true sessions for scripting. If/when they add support for sessions, we can make the update to the DB-API and test it with this SQLAlchemy connector. |
Sorry to drag up an old issue, but this is where I was looking to figure out how to write such a query using bigquery sqlalchemy. I'm assuming the SET/DECLARE statements need to be created using Relatedly, is there a way to do a Happy to file a new issue along the lines of |
I'm having an issue running a chain of statements that depend on each other in a common session. I'm using a single connection and cursor behind the scene.
It appears that the statements are not chained and the session isn't persisted. Any clue on how to solve this?
Other DBAPI implementations allow this type of chaining, and using the same logic with this driver does not work properly.
The text was updated successfully, but these errors were encountered: