-
Notifications
You must be signed in to change notification settings - Fork 114
feat(csharp/src/Drivers/BigQuery): support evaluation kind and statement type setting #2698
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
feat(csharp/src/Drivers/BigQuery): support evaluation kind and statement type setting #2698
Conversation
Is there a specific multi-statement test that should be added (presumably from both the DriverTests and the ClientTests)? |
|
The way I would do something like this is for any environment that can execute a query. For example, something like:
This will work without any tables being created and you can validate the result(s) of the multi-statement evaluation. An alternative way could be to use the BigQuery public datasets to retrieve data as well. |
Thanks, have added. |
I feel like I don't entirely understand this change, so it would be nice to get a little more explanation. Today, there's a limitation in ADBC which prevents a single execution batch from returning multiple results. Now obviously, multiple statements doesn't have to mean multiple results because a statement could be e.g. DDL or BEGIN TRAN or some other thing which impacts session state. But accepting multiple statements implies that they could each be returning results, and that's where things feel a little sketchy. It looks like the two added parameters are intended to filter down the set of results in order to pick just one. But they do so in a way that doesn't (to me) obviously ensure that only one result will match the criteria. What if there are two results with the same statement type and evaluation kind? Picking the first one feels a little arbitrary. What I'd naively expect if I passed multiple statements and needed to indicate which one's results I wanted would be to supply the index of the statement. So for "statement1; statement2; statement3", if I wanted the results from statement2 I might pass either 1 or 2 depending on how I feel about zero-indexing vs one-indexing. Is the current design something that users of the e.g. BigQuery ODBC driver would already be familiar with? |
(Also, it would be nice if we tried to maintain some alignment between the C# BigQuery driver and the Go BigQuery driver -- though it may already be a little late for that :(. CC: @lidavidm for possible additional feedback.) |
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.
The change looks mechanically fine; I just have questions around the API.
We started the C# one before the Go one was available and I haven’t followed the Go one too closely. |
Your understanding is very accurate. The behavior of picking the first one statement is designed because the Connector implemented by the previous BigQuery ODBC driver has such behavior, which is also the behavior that customers want. Supplying the index of the statement is indeed a reasonable feature, but there is no specific customer demand at present. I can add it, you can take a look first. |
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!
Support evaluation kind and statement type setting for GBQ driver, and improve code at BigQueryStatement.cs.