This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 15ad9d185 feat(csharp/src/Drivers/BigQuery): add additional billing
and timeout properties and test settings (#2566)
15ad9d185 is described below
commit 15ad9d185e255978ac00184bd31d8669098392da
Author: davidhcoe <[email protected]>
AuthorDate: Mon Mar 3 18:56:09 2025 -0500
feat(csharp/src/Drivers/BigQuery): add additional billing and timeout
properties and test settings (#2566)
- adds the `adbc.bigquery.client.timeout` value for the BigQueryClient
- adds the `adbc.bigquery.billing_project_id` value for the billing
queries against
- adds support for referencing shared values in multi-environment test
configurations
- adds tests for the new settings
---------
Co-authored-by: David Coe <>
---
csharp/src/Drivers/BigQuery/BigQueryConnection.cs | 28 +++++++++++++--
csharp/src/Drivers/BigQuery/BigQueryParameters.cs | 4 ++-
csharp/src/Drivers/BigQuery/BigQueryStatement.cs | 24 +++++--------
csharp/src/Drivers/BigQuery/readme.md | 8 ++++-
.../MultiEnvironmentTestConfiguration.cs | 8 +++++
.../MultiEnvironmentTestUtils.cs | 27 ++++++++++++---
.../Drivers/BigQuery/BigQueryTestConfiguration.cs | 25 +++++++++++++-
.../test/Drivers/BigQuery/BigQueryTestingUtils.cs | 17 ++++++++-
csharp/test/Drivers/BigQuery/DriverTests.cs | 39 +++++++++++++++++++++
.../Drivers/BigQuery/Resources/bigqueryconfig.json | 23 +++++++++++--
csharp/test/Drivers/BigQuery/readme.md | 40 +++++++++++++---------
11 files changed, 198 insertions(+), 45 deletions(-)
diff --git a/csharp/src/Drivers/BigQuery/BigQueryConnection.cs
b/csharp/src/Drivers/BigQuery/BigQueryConnection.cs
index a0c70c63f..447f288f3 100644
--- a/csharp/src/Drivers/BigQuery/BigQueryConnection.cs
+++ b/csharp/src/Drivers/BigQuery/BigQueryConnection.cs
@@ -73,9 +73,11 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
internal BigQueryClient Open()
{
string? projectId = null;
+ string? billingProjectId = null;
string? clientId = null;
string? clientSecret = null;
string? refreshToken = null;
+ TimeSpan? clientTimeout = null;
string tokenEndpoint = BigQueryConstants.TokenEndpoint;
@@ -87,6 +89,9 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
if (!this.properties.TryGetValue(BigQueryParameters.ProjectId, out
projectId))
projectId = BigQueryConstants.DetectProjectId;
+ // the billing project can be null if it's not specified
+ this.properties.TryGetValue(BigQueryParameters.BillingProjectId,
out billingProjectId);
+
if
(this.properties.TryGetValue(BigQueryParameters.IncludePublicProjectId, out
string? result))
{
if (!string.IsNullOrEmpty(result))
@@ -128,7 +133,26 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
this.credential = ApplyScopes(GoogleCredential.FromJson(json));
}
- BigQueryClient client = BigQueryClient.Create(projectId,
this.credential);
+ if (this.properties.TryGetValue(BigQueryParameters.ClientTimeout,
out string? timeoutSeconds) &&
+ int.TryParse(timeoutSeconds, out int seconds))
+ {
+ clientTimeout = TimeSpan.FromSeconds(seconds);
+ }
+
+ BigQueryClientBuilder bigQueryClientBuilder = new
BigQueryClientBuilder()
+ {
+ ProjectId = projectId,
+ QuotaProject = billingProjectId,
+ GoogleCredential = this.credential
+ };
+
+ BigQueryClient client = bigQueryClientBuilder.Build();
+
+ if (clientTimeout.HasValue)
+ {
+ client.Service.HttpClient.Timeout = clientTimeout.Value;
+ }
+
this.client = client;
return client;
}
@@ -1033,7 +1057,7 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
BigQueryParameters.UseLegacySQL,
BigQueryParameters.LargeDecimalsAsString,
BigQueryParameters.LargeResultsDestinationTable,
- BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes,
+ BigQueryParameters.GetQueryResultsOptionsTimeout,
BigQueryParameters.MaxFetchConcurrency
};
diff --git a/csharp/src/Drivers/BigQuery/BigQueryParameters.cs
b/csharp/src/Drivers/BigQuery/BigQueryParameters.cs
index 101a2dafa..abfb7c102 100644
--- a/csharp/src/Drivers/BigQuery/BigQueryParameters.cs
+++ b/csharp/src/Drivers/BigQuery/BigQueryParameters.cs
@@ -23,6 +23,7 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
public class BigQueryParameters
{
public const string ProjectId = "adbc.bigquery.project_id";
+ public const string BillingProjectId =
"adbc.bigquery.billing_project_id";
public const string ClientId = "adbc.bigquery.client_id";
public const string ClientSecret = "adbc.bigquery.client_secret";
public const string RefreshToken = "adbc.bigquery.refresh_token";
@@ -34,7 +35,8 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
public const string LargeDecimalsAsString =
"adbc.bigquery.large_decimals_as_string";
public const string Scopes = "adbc.bigquery.scopes";
public const string IncludeConstraintsWithGetObjects =
"adbc.bigquery.include_constraints_getobjects";
- public const string GetQueryResultsOptionsTimeoutMinutes =
"adbc.bigquery.get_query_results_options.timeout";
+ public const string ClientTimeout = "adbc.bigquery.client.timeout";
+ public const string GetQueryResultsOptionsTimeout =
"adbc.bigquery.get_query_results_options.timeout";
public const string MaxFetchConcurrency =
"adbc.bigquery.max_fetch_concurrency";
public const string IncludePublicProjectId =
"adbc.bigquery.include_public_project_id";
}
diff --git a/csharp/src/Drivers/BigQuery/BigQueryStatement.cs
b/csharp/src/Drivers/BigQuery/BigQueryStatement.cs
index 35750f5b4..a4df83043 100644
--- a/csharp/src/Drivers/BigQuery/BigQueryStatement.cs
+++ b/csharp/src/Drivers/BigQuery/BigQueryStatement.cs
@@ -57,15 +57,11 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
GetQueryResultsOptions getQueryResultsOptions = new
GetQueryResultsOptions();
- if
(this.Options?.TryGetValue(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes,
out string? timeoutMinutes) == true)
+ if
(this.Options?.TryGetValue(BigQueryParameters.GetQueryResultsOptionsTimeout,
out string? timeoutSeconds) == true &&
+ int.TryParse(timeoutSeconds, out int seconds) &&
+ seconds >= 0)
{
- if (int.TryParse(timeoutMinutes, out int minutes))
- {
- if (minutes >= 0)
- {
- getQueryResultsOptions.Timeout =
TimeSpan.FromMinutes(minutes);
- }
- }
+ getQueryResultsOptions.Timeout = TimeSpan.FromSeconds(seconds);
}
BigQueryResults results =
job.GetQueryResults(getQueryResultsOptions);
@@ -126,15 +122,11 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
QueryOptions options = ValidateOptions();
GetQueryResultsOptions getQueryResultsOptions = new
GetQueryResultsOptions();
- if
(this.Options?.TryGetValue(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes,
out string? timeoutMinutes) == true)
+ if
(this.Options?.TryGetValue(BigQueryParameters.GetQueryResultsOptionsTimeout,
out string? timeoutSeconds) == true &&
+ int.TryParse(timeoutSeconds, out int seconds) &&
+ seconds >= 0)
{
- if (int.TryParse(timeoutMinutes, out int minutes))
- {
- if (minutes >= 0)
- {
- getQueryResultsOptions.Timeout =
TimeSpan.FromMinutes(minutes);
- }
- }
+ getQueryResultsOptions.Timeout = TimeSpan.FromSeconds(seconds);
}
BigQueryResults result = this.client.ExecuteQuery(
diff --git a/csharp/src/Drivers/BigQuery/readme.md
b/csharp/src/Drivers/BigQuery/readme.md
index f7adb3958..823a066fa 100644
--- a/csharp/src/Drivers/BigQuery/readme.md
+++ b/csharp/src/Drivers/BigQuery/readme.md
@@ -42,17 +42,23 @@ The following parameters can be used to configure the
driver behavior. The param
https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_AllowLargeResults
+**adbc.bigquery.billing_project_id**<br>
+ The [Project
ID](https://cloud.google.com/resource-manager/docs/creating-managing-projects)
used for accessing billing BigQuery. If not specified, will default to the
detected project ID.
+
**adbc.bigquery.client_id**<br>
The OAuth client ID. Required for `user`
authentication.
**adbc.bigquery.client_secret**<br>
The OAuth client secret. Required for `user`
authentication.
+**adbc.bigquery.client.timeout**<br>
+ Optional. Sets the timeout (in seconds) for the
BigQueryClient. Similar to a ConnectionTimeout.
+
**adbc.bigquery.auth_json_credential**<br>
Required if using `service` authentication. This value
is passed to the
[GoogleCredential.FromJson](https://cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.GoogleCredential#Google_Apis_Auth_OAuth2_GoogleCredential_FromJson_System_String)
method.
**adbc.bigquery.get_query_results_options.timeout**<br>
- Optional. Sets the timeout (in minutes) for the
GetQueryResultsOptions value. If not set, defaults to 5 minutes.
+ Optional. Sets the timeout (in seconds) for the
GetQueryResultsOptions value. If not set, defaults to 5 minutes. Similar to a
CommandTimeout.
**adbc.bigquery.max_fetch_concurrency**<br>
Optional. Sets the
[maxStreamCount](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.Storage.V1/latest/Google.Cloud.BigQuery.Storage.V1.BigQueryReadClient#Google_Cloud_BigQuery_Storage_V1_BigQueryReadClient_CreateReadSession_System_String_Google_Cloud_BigQuery_Storage_V1_ReadSession_System_Int32_Google_Api_Gax_Grpc_CallSettings_)
for the CreateReadSession method. If not set, defaults to 1.
diff --git
a/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestConfiguration.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestConfiguration.cs
index 33331dbd0..872b98a62 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestConfiguration.cs
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestConfiguration.cs
@@ -15,7 +15,9 @@
* limitations under the License.
*/
+using System;
using System.Collections.Generic;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Apache.Arrow.Adbc.Tests
@@ -42,5 +44,11 @@ namespace Apache.Arrow.Adbc.Tests
/// </summary>
[JsonPropertyName("environments")]
public Dictionary<string, T> Environments { get; set; } = new
Dictionary<string, T>();
+
+ /// <summary>
+ /// Values that are shared across environments so they don't need to
be repeated.
+ /// </summary>
+ [JsonPropertyName("shared")]
+ public Dictionary<string, string> SharedKeyValuePairs { get; set; } =
new Dictionary<string, string>();
}
}
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestUtils.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestUtils.cs
index aba4f6723..8aaee722a 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestUtils.cs
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/MultiEnvironmentTestUtils.cs
@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Reflection;
using System.Text.Json;
namespace Apache.Arrow.Adbc.Tests
@@ -38,7 +39,6 @@ namespace Apache.Arrow.Adbc.Tests
{
// use a JSON file for the various settings
string json = File.ReadAllText(environmentValue);
-
testConfiguration =
JsonSerializer.Deserialize<T>(json)!;
}
}
@@ -60,17 +60,34 @@ namespace Apache.Arrow.Adbc.Tests
throw new InvalidOperationException("There are no environments
configured");
List<TEnvironment> environments = new List<TEnvironment>();
+ string term = "$ref:shared.";
foreach (string environmentName in
GetEnvironmentNames(testConfiguration.TestEnvironmentNames))
{
- if
(testConfiguration.Environments.TryGetValue(environmentName, out TEnvironment?
testEnvironment))
+ if
(!testConfiguration.Environments.TryGetValue(environmentName, out TEnvironment?
testEnvironment) || testEnvironment is null)
+ continue;
+
+ testEnvironment.Name = environmentName;
+
+ if (testConfiguration.SharedKeyValuePairs.Count > 0)
{
- if (testEnvironment != null)
+ foreach (PropertyInfo pi in
testEnvironment.GetType().GetProperties())
{
- testEnvironment.Name = environmentName;
- environments.Add(testEnvironment);
+ if (pi.PropertyType == typeof(string) &&
+ pi.GetValue(testEnvironment) is string
propertyValue &&
+ propertyValue.StartsWith(term,
StringComparison.Ordinal))
+ {
+ string lookupKey =
propertyValue.AsSpan(term.Length).ToString();
+
+ if
(testConfiguration.SharedKeyValuePairs.TryGetValue(lookupKey, out string?
sharedValue))
+ {
+ pi.SetValue(testEnvironment, sharedValue);
+ }
+ }
}
}
+
+ environments.Add(testEnvironment);
}
if (environments.Count == 0)
diff --git a/csharp/test/Drivers/BigQuery/BigQueryTestConfiguration.cs
b/csharp/test/Drivers/BigQuery/BigQueryTestConfiguration.cs
index b045a679f..f736979bc 100644
--- a/csharp/test/Drivers/BigQuery/BigQueryTestConfiguration.cs
+++ b/csharp/test/Drivers/BigQuery/BigQueryTestConfiguration.cs
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
@@ -41,6 +40,9 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
[JsonPropertyName("projectId")]
public string? ProjectId { get; set; }
+ [JsonPropertyName("billingProjectId")]
+ public string? BillingProjectId { get; set; }
+
[JsonPropertyName("clientId")]
public string ClientId { get; set; } = string.Empty;
@@ -68,9 +70,30 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
[JsonPropertyName("includePublicProjectId")]
public bool IncludePublicProjectId { get; set; } = false;
+ /// <summary>
+ /// Sets the query timeout (in minutes).
+ /// </summary>
[JsonPropertyName("timeoutMinutes")]
public int? TimeoutMinutes { get; set; }
+ /// <summary>
+ /// Sets the query timeout (in seconds).
+ /// </summary>
+ [JsonPropertyName("queryTimeout")]
+ public int? QueryTimeout { get; set; }
+
+ /// <summary>
+ /// The number of seconds to allow for the HttpClient timeout.
+ /// </summary>
+ [JsonPropertyName("clientTimeout")]
+ public int? ClientTimeout { get; set; }
+
+ /// <summary>
+ /// Indicates if timeout tests should run during this execution.
+ /// </summary>
+ [JsonPropertyName("runTimeoutTests")]
+ public bool RunTimeoutTests { get; set; } = false;
+
[JsonPropertyName("maxStreamCount")]
public int? MaxStreamCount { get; set; }
}
diff --git a/csharp/test/Drivers/BigQuery/BigQueryTestingUtils.cs
b/csharp/test/Drivers/BigQuery/BigQueryTestingUtils.cs
index c1dd14a6d..5768b7e0c 100644
--- a/csharp/test/Drivers/BigQuery/BigQueryTestingUtils.cs
+++ b/csharp/test/Drivers/BigQuery/BigQueryTestingUtils.cs
@@ -58,6 +58,11 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
parameters.Add(BigQueryParameters.ProjectId,
testEnvironment.ProjectId!);
}
+ if (!string.IsNullOrEmpty(testEnvironment.BillingProjectId))
+ {
+ parameters.Add(BigQueryParameters.BillingProjectId,
testEnvironment.BillingProjectId!);
+ }
+
if (!string.IsNullOrEmpty(testEnvironment.JsonCredential))
{
parameters.Add(BigQueryParameters.AuthenticationType,
BigQueryConstants.ServiceAccountAuthenticationType);
@@ -92,7 +97,17 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
if (testEnvironment.TimeoutMinutes.HasValue)
{
-
parameters.Add(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes,
testEnvironment.TimeoutMinutes.Value.ToString());
+ int seconds = testEnvironment.TimeoutMinutes.Value * 60;
+
parameters.Add(BigQueryParameters.GetQueryResultsOptionsTimeout,
seconds.ToString());
+ }
+ else if (testEnvironment.QueryTimeout.HasValue)
+ {
+
parameters.Add(BigQueryParameters.GetQueryResultsOptionsTimeout,
testEnvironment.QueryTimeout.Value.ToString());
+ }
+
+ if (testEnvironment.ClientTimeout.HasValue)
+ {
+ parameters.Add(BigQueryParameters.ClientTimeout,
testEnvironment.ClientTimeout.Value.ToString());
}
if (testEnvironment.MaxStreamCount.HasValue)
diff --git a/csharp/test/Drivers/BigQuery/DriverTests.cs
b/csharp/test/Drivers/BigQuery/DriverTests.cs
index 76447b576..12f061a6a 100644
--- a/csharp/test/Drivers/BigQuery/DriverTests.cs
+++ b/csharp/test/Drivers/BigQuery/DriverTests.cs
@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
using Apache.Arrow.Adbc.Drivers.BigQuery;
using Apache.Arrow.Adbc.Tests.Metadata;
using Apache.Arrow.Adbc.Tests.Xunit;
@@ -307,5 +308,43 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.BigQuery
return _configuredConnections[environmentName!];
}
+
+ /// <summary>
+ /// Validates the ClientTimeout parameter.
+ /// </summary>
+ [SkippableFact, Order(7)]
+ public void ClientTimeoutTest()
+ {
+ foreach (BigQueryTestEnvironment environment in _environments)
+ {
+ if (environment.RunTimeoutTests &&
environment.ClientTimeout.HasValue)
+ {
+ AdbcConnection adbcConnection =
BigQueryTestingUtils.GetBigQueryAdbcConnection(environment);
+
+ AdbcStatement statement = adbcConnection.CreateStatement();
+ statement.SqlQuery = environment.Query;
+
+ Assert.Throws<TaskCanceledException>(() => {
statement.ExecuteQuery(); });
+ }
+ }
+ }
+
+ /// <summary>
+ /// Validates the GetQueryResultsOptionsTimeoutMinutes parameter.
+ /// </summary>
+ [SkippableFact, Order(8)]
+ public void QueryTimeoutTest()
+ {
+ foreach (BigQueryTestEnvironment environment in _environments)
+ {
+ if (environment.RunTimeoutTests &&
(environment.QueryTimeout.HasValue || environment.TimeoutMinutes.HasValue))
+ {
+ AdbcConnection adbcConnection =
BigQueryTestingUtils.GetBigQueryAdbcConnection(environment);
+ AdbcStatement statement = adbcConnection.CreateStatement();
+ statement.SqlQuery = environment.Query;
+ Assert.Throws<TimeoutException>(() => {
statement.ExecuteQuery(); });
+ }
+ }
+ }
}
}
diff --git a/csharp/test/Drivers/BigQuery/Resources/bigqueryconfig.json
b/csharp/test/Drivers/BigQuery/Resources/bigqueryconfig.json
index 01cbe84f4..ea2f29a27 100644
--- a/csharp/test/Drivers/BigQuery/Resources/bigqueryconfig.json
+++ b/csharp/test/Drivers/BigQuery/Resources/bigqueryconfig.json
@@ -1,10 +1,14 @@
{
"testEnvironments": [ "", "" ],
+ "shared": {
+ "clientId": "clientId_example",
+ "clientSecret": "clientSecret_example"
+ }
"environments": {
"<env1>": {
"projectId": "",
- "clientId": "",
- "clientSecret": "",
+ "clientId": "$ref:shared.clientId",
+ "clientSecret": "$ref:shared.clientSecret",
"refreshToken": "",
"maxStreamCount": 1,
"metadata": {
@@ -17,6 +21,21 @@
"expectedResults": 0
},
"<env2>": {
+ "projectId": "",
+ "clientId": "$ref:shared.clientId",
+ "clientSecret": "$ref:shared.clientSecret",
+ "refreshToken": "",
+ "maxStreamCount": 1,
+ "metadata": {
+ "catalog": "",
+ "schema": "",
+ "table": "",
+ "expectedColumnCount": 0
+ },
+ "query": "",
+ "expectedResults": 0
+ },
+ "<env3>": {
"projectId": "",
"clientId": "",
"clientSecret": "",
diff --git a/csharp/test/Drivers/BigQuery/readme.md
b/csharp/test/Drivers/BigQuery/readme.md
index 26f177da4..5d6db3d16 100644
--- a/csharp/test/Drivers/BigQuery/readme.md
+++ b/csharp/test/Drivers/BigQuery/readme.md
@@ -27,22 +27,30 @@ The environment variable `BIGQUERY_TEST_CONFIG_FILE` must
be set to a configurat
The following values can be setup in the configuration
-- **projectId** - The project ID of the default BigQuery project to query
against.
-- **clientId** - The project ID of the default BigQuery project to query
against.
-- **clientSecret** - Secret of the application used to generate the refresh
token.
-- **refreshToken** - The refresh token obtained from Google used to authorize
access to BigQuery.
-- metadata
- - **database** - Used by metadata tests for which database to target.
- - **schema** - Used by metadata tests for which schema to target.
- - **table** - Used by metadata tests for which table to target.
- - **expectedColumnCount** - Used by metadata tests to validate the number of
columns that are returned.
-- **query** - The query to use.
-- **expectedResults** - The expected number of results from the query.
-- **timeoutMinutes** - The timeout (in minutes).
-- **maxStreamCount** - The max stream count.
-- **includeTableConstraints** - Whether to include table constraints in the
GetObjects query.
-- **largeResultsDestinationTable** - Sets the
[DestinationTable](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_DestinationTable)
value of the QueryOptions if configured. Expects the format to be
`{projectId}.{datasetId}.{tableId}` to set the corresponding values in the
[TableReference](https://github.com/googleapis/google-api-dotnet-client/blob/6c415c73788b848711e47c6dd33c2f93c76f
[...]
-- **allowLargeResults** - Whether to allow large results .
+- **testEnvironments** - List of test environments that are used when running
tests. Tests can be configured that are not executed.
+- **shared** - values that are shared across environments. These are
referenced as `$ref:shared.<key>` in the environments.
+- **environments** - Dictionary of the configured environments. The key must
be listed in `testEnvironments` to execute during a test run.
+ - **projectId** - Optional. The project ID of the default BigQuery project
to query against.
+ - **billingProjectId** - Optional. The billing project ID, also known as the
quota project ID, that queries are billed to. Does not need to match the
`projectId` value.
+ - **clientId** - The client ID that is used during authentication.
+ - **clientSecret** - Secret of the application used to generate the refresh
token.
+ - **refreshToken** - The refresh token obtained from Google used to
authorize access to BigQuery.
+ - **clientTimeout** - The timeout (in seconds) for the underlying
BigQueryClient. Similar to a ConnectionTimeout.
+ - **metadata**
+ - **database** - Used by metadata tests for which database to target.
+ - **schema** - Used by metadata tests for which schema to target.
+ - **table** - Used by metadata tests for which table to target.
+ - **expectedColumnCount** - Used by metadata tests to validate the number
of columns that are returned.
+ - **query** - The query to use.
+ - **expectedResults** - The expected number of results from the query.
+ - **includePublicProjectId** - True/False to indicate if the public projects
should be included in the result set.
+ - **scopes** - Comma separated list (string) of scopes applied during the
test.
+ - **queryTimeout** - The timeout (in seconds) for a query. Similar to a
CommandTimeout.
+ - **maxStreamCount** - The max stream count.
+ - **includeTableConstraints** - Whether to include table constraints in the
GetObjects query.
+ - **largeResultsDestinationTable** - Sets the
[DestinationTable](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_DestinationTable)
value of the QueryOptions if configured. Expects the format to be
`{projectId}.{datasetId}.{tableId}` to set the corresponding values in the
[TableReference](https://github.com/googleapis/google-api-dotnet-client/blob/6c415c73788b848711e47c6dd33c2f93c7
[...]
+ - **allowLargeResults** - Whether to allow large results .
+ - **runTimeoutTests** - indicates if the timeout tests should be run for
this configuration. Default is false.
## Data
This project contains a SQL script to generate BigQuery data in the
`resources/BigQueryData.sql` file. This can be used to populate a table in your
BigQuery instance with data.