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

Returns only one resultset when executing Procedure #3772

Closed
gowthammano opened this issue Nov 19, 2019 · 2 comments
Closed

Returns only one resultset when executing Procedure #3772

gowthammano opened this issue Nov 19, 2019 · 2 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue.

Comments

@gowthammano
Copy link

I'm using the Google.Cloud.BigQuery.V2 version="1.4.0-beta06" to execute CALL ();
My Procedure calls 2 other procedures, each of which has a resultset.
When executing the wrapper procedure via console, I can see both result sets by clicking on "VIEW RESULTS".
But via code, bqClient.ExecuteQuery returns only the second result set.

@amanda-tarafa amanda-tarafa self-assigned this Nov 19, 2019
@amanda-tarafa amanda-tarafa added api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue. labels Nov 19, 2019
@amanda-tarafa
Copy link
Contributor

I believe this might be that the API is only returning the last result set. I will confirm with the BigQuery team and update this thread with more info.

@amanda-tarafa
Copy link
Contributor

I've been able to reproduce this without the need of calling procedures. When executing the code below, only one row is returned, the one corresponding to the last SELECT.

BigQueryClient client = BigQueryClient.Create(ProjectId);

string sql = "SELECT 5; SELECT 6, 7;";
BigQueryResults results = client.ExecuteQuery(sql, null).ThrowOnAnyError();

BigQueryRow row = results.Single();
Console.WriteLine($"Returned row: ({row[0]}, {row[1]})");

This is not a client library issue though, BigQueryResult is wrapping the response from jobs.getQueryResults API method to provide seemless result pagination, but not much more. The jobs.getQueryResults response is not clearly designed to support returning multiple result sets, and the API method is definetely not doing so at the moment.

This looks more like a feature request for the BigQuery API team, so I'd advise you to create a feature request for them here.
You can also take a look and vote on other open issues/feature requests here.

I'll be closing this issue for now, since I believe there's nothing we can do on the client library side. Please feel free to reopen if you believe different, or create new issues if you encounter other problems using the client library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants