qifanzhang-ms commented on code in PR #2165:
URL: https://github.com/apache/arrow-adbc/pull/2165#discussion_r1767825207
##########
csharp/src/Drivers/BigQuery/BigQueryStatement.cs:
##########
@@ -75,6 +76,24 @@ public override QueryResult ExecuteQuery()
readClientBuilder.Credential = this.credential;
BigQueryReadClient readClient = readClientBuilder.Build();
+ if (results.TableReference == null)
+ {
+ ListJobsOptions listJobsOptions = new ListJobsOptions();
+ listJobsOptions.ParentJobId = results.JobReference.JobId;
+ PagedEnumerable<JobList, BigQueryJob> joblist =
client.ListJobs(listJobsOptions);
+ BigQueryJob firstQueryJob = new BigQueryJob(client,
job.Resource);
+ foreach (BigQueryJob childJob in joblist)
+ {
+ var tempJob = client.GetJob(childJob.Reference.JobId);
+ var query = tempJob.Resource?.Configuration?.Query;
+ if (query != null && query.DestinationTable != null &&
query.DestinationTable.ProjectId != null && query.DestinationTable.DatasetId !=
null && query.DestinationTable.TableId != null)
Review Comment:
When the query is a stored procedure or multiple statements, the null
problem will be triggered stably. When there are multiple child query jobs, the
result of the first query will be returned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]