Skip to content

Commit 373fde8

Browse files
fix(csharp/src/Drivers/BigQuery): Fix the bug about QueryResultsOptions and script statement (apache#2796)
1 parent f6c1019 commit 373fde8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

csharp/src/Drivers/BigQuery/BigQueryStatement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private async Task<QueryResult> ExecuteQueryInternalAsync()
118118
{
119119
// if the authentication token was reset, then we need a new job with the latest token
120120
BigQueryJob completedJob = await Client.GetJobAsync(jobReference);
121-
return await completedJob.GetQueryResultsAsync();
121+
return await completedJob.GetQueryResultsAsync(getQueryResultsOptions);
122122
};
123123

124124
BigQueryResults results = await ExecuteWithRetriesAsync(getJobResults);
@@ -130,8 +130,8 @@ private async Task<QueryResult> ExecuteQueryInternalAsync()
130130
clientMgr.UpdateCredential(Credential);
131131
});
132132

133-
// For multi-statement queries, the results.TableReference is null
134-
if (results.TableReference == null)
133+
// For multi-statement queries, StatementType == "SCRIPT"
134+
if (results.TableReference == null || job.Statistics.Query.StatementType.Equals("SCRIPT", StringComparison.OrdinalIgnoreCase))
135135
{
136136
string statementType = string.Empty;
137137
if (Options?.TryGetValue(BigQueryParameters.StatementType, out string? statementTypeString) == true)

0 commit comments

Comments
 (0)