Apache.Arrow.Adbc.Drivers.BigQuery
0.20.0
dotnet add package Apache.Arrow.Adbc.Drivers.BigQuery --version 0.20.0
NuGet\Install-Package Apache.Arrow.Adbc.Drivers.BigQuery -Version 0.20.0
<PackageReference Include="Apache.Arrow.Adbc.Drivers.BigQuery" Version="0.20.0" />
<PackageVersion Include="Apache.Arrow.Adbc.Drivers.BigQuery" Version="0.20.0" />
<PackageReference Include="Apache.Arrow.Adbc.Drivers.BigQuery" />
paket add Apache.Arrow.Adbc.Drivers.BigQuery --version 0.20.0
#r "nuget: Apache.Arrow.Adbc.Drivers.BigQuery, 0.20.0"
#:package Apache.Arrow.Adbc.Drivers.BigQuery@0.20.0
#addin nuget:?package=Apache.Arrow.Adbc.Drivers.BigQuery&version=0.20.0
#tool nuget:?package=Apache.Arrow.Adbc.Drivers.BigQuery&version=0.20.0
BigQuery
The BigQuery ADBC driver wraps a BigQueryClient object for working with Google BigQuery data.
Supported Features
Authentication
The ADBC driver supports both Service and User accounts for use with BigQuery authentication.
Authorization
The ADBC driver passes the configured credentials to BigQuery, but you may need to ensure the credentials have proper authorization to perform operations such as read and write.
Parameters
The following parameters can be used to configure the driver behavior. The parameters are case sensitive.
adbc.bigquery.access_token<br> Sets the access token to use as the credential. Currently, this is for Microsoft Entra, but this could be used for other OAuth implementations as well.
adbc.bigquery.audience_uri<br> Sets the audience URI for the authentication token. Currently, this is for Microsoft Entra, but this could be used for other OAuth implementations as well.
adbc.bigquery.allow_large_results<br>
Sets the AllowLargeResults value of the QueryOptions to true
if configured; otherwise, the default is false
.
adbc.bigquery.auth_type<br>
Required. Must be user
, aad
(for Microsoft Entra) or service
.
adbc.bigquery.billing_project_id<br> The Project ID 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 method.
adbc.bigquery.get_query_results_options.timeout<br> Optional. Sets the timeout (in seconds) for the GetQueryResultsOptions value. If not set, defaults to 5 minutes. Similar to a CommandTimeout.
adbc.bigquery.maximum_retries<br> Optional. The maximum number of retries. Defaults to 5.
adbc.bigquery.max_fetch_concurrency<br> Optional. Sets the maxStreamCount for the CreateReadSession method. If not set, defaults to 1.
adbc.bigquery.multiple_statement.statement_type<br> Optional. When executing multiple statements, limit the type of statement returned. If not set, all types of statements are returned.
adbc.bigquery.multiple_statement.statement_index<br> Optional. When executing multiple statements, specify the result of the statement to be returned (Minimum value is 1). If not set, the result of the first statement is returned.
adbc.bigquery.multiple_statement.evaluation_kind<br> Optional. When executing multiple statements, limit the evaluation kind returned. If not set, all evaluation kinds are returned.
adbc.bigquery.include_constraints_getobjects<br>
Optional. Some callers do not need the constraint details when they get the table information and can improve the speed of obtaining the results. Setting this value to "false"
will not include the constraint details. The default value is "true"
.
adbc.bigquery.include_public_project_id<br>
Include the bigquery-public-data
project ID with the list of project IDs.
adbc.bigquery.large_results_dataset<br>
Optional. Sets the dataset ID to use for large results. The dataset needs to be in the same region as the data being queried. If no value is specified, the driver will attempt to use or create _bqadbc_temp_tables
. A randomly generated table name will be used for the DestinationTable.
adbc.bigquery.large_results_destination_table<br>
Optional. Sets the DestinationTable value of the QueryOptions if configured. Expects the format to be {projectId}.{datasetId}.{tableId}
to set the corresponding values in the TableReference class.
adbc.bigquery.project_id<br> The Project ID used for accessing BigQuery. If not specified, will default to detect the projectIds the credentials have access to.
adbc.bigquery.refresh_token<br>
The refresh token used for when the generated OAuth token expires. Required for user
authentication.
adbc.bigquery.retry_delay_ms<br>
Optional The delay between retries. Defaults to 200ms. The retries could take up to adbc.bigquery.maximum_retries
x adbc.bigquery.retry_delay_ms
to complete.
adbc.bigquery.scopes<br> Optional. Comma separated list of scopes to include for the credential.
adbc.bigquery.use_legacy_sql<br>
Sets the UseLegacySql value of the QueryOptions to true
if configured; otherwise, the default is false
.
Type Support
There are some limitations to both C# and the C# Arrow implementation that limit how BigQuery data types that can be represented by the ADBC driver. For example, the BIGNUMERIC
type in BigQuery does not have a large value equivalent to C#.
The following table depicts how the BigQuery ADBC driver converts a BigQuery type to an Arrow type.
BigQuery Type | Arrow Type | C# Type |
---|---|---|
BIGNUMERIC | Decimal256 | string |
BOOL | Boolean | bool |
BYTES | Binary | byte[] |
DATE | Date32 | DateTime |
DATETIME | Timestamp | DateTime |
FLOAT64 | Double | double |
GEOGRAPHY | String | string |
INT64 | Int64 | long |
NUMERIC | Decimal128 | SqlDecimal |
STRING | String | string |
STRUCT | String+ | string |
TIME | Time64 | long |
TIMESTAMP | Timestamp | DateTimeOffset |
+A JSON string
See Arrow Schema Details for how BigQuery handles Arrow types.
Microsoft Entra
The driver supports authenticating with a Microsoft Entra ID. For long running operations, the Entra token may timeout if the operation takes longer than the Entra token's lifetime. The driver has the ability to perform token refreshes by subscribing to the UpdateToken
delegate on the BigQueryConnection
. In this scenario, the driver will attempt to perform an operation. If that operation fails due to an Unauthorized error, then the token will be refreshed via the UpdateToken
delegate.
Sample code to refresh the token:
Dictionary<string,string> properties = ...;
BigQueryConnection connection = new BigQueryConnection(properties);
connection.UpdateToken = () => Task.Run(() =>
{
connection.SetOption(BigQueryParameters.AccessToken, GetAccessToken());
});
In the sample above, when a new token is needed, the delegate is invoked and updates the adbc.bigquery.access_token
parameter on the connection object.
Default Project ID
If a adbc.bigquery.project_id
is not specified, or if it equals bigquery-public-data
, the driver will query for the first project ID that is associated with the credentials provided. This will be the project ID that is used to perform queries.
Large Results
If a result set will contain large results, the adbc.bigquery.allow_large_results
parameter should be set to "true"
. If this value is set, a destination must be specified.
The caller can either explicitly specify the fully qualified name of the destination table using the adbc.bigquery.large_results_destination_table
value, or they can specify
a dataset using the adbc.bigquery.large_results_dataset
parameter.
Behavior:
- If a destination table is explicitly set, the driver will use that value.
- If only a dataset value is set, the driver will attempt to retrieve the dataset. If the dataset does not exist, the driver will attempt to create it. The default table expiration will be set to 1 day. A randomly generated name will be used for the table name.
- If a destination table and a dataset are not specified, the driver will attempt to use or create the
_bqadbc_temp_tables
dataset using the same defaults and label specified above. A randomly generated name will be used for the table name.
Permissions
The ADBC driver uses the BigQuery Client APIs to communicate with BigQuery. The following actions are performed in the driver and require the calling user to have the specified permissions. For more details on the permissions, or what roles may already have the permissions required, please see the additional references section below.
Action | Permissions Required |
---|---|
Create Dataset<sup>*+</sup> | bigquery.datasets.create |
Create Query Job | bigquery.jobs.create |
Create Read Session | bigquery.readsessions.create<br> bigquery.tables.getData |
Execute Query | bigquery.jobs.create<br> bigquery.jobs.get<br> bigquery.jobs.list |
Get Dataset<sup>*</sup> | bigquery.datasets.get |
Get Job | bigquery.jobs.get |
Get Query Results | bigquery.jobs.get |
List Jobs | bigquery.jobs.list |
Read Rows | bigquery.readsessions.getData |
<sup> *Only for large result sets<br> +If a specified dataset does not already exist. </sup> <br> <br>
Some environments may also require:
- VPC Service Controls
- Service Usage Consumer permissions
Additional References:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- Apache.Arrow.Adbc (>= 0.20.0)
- Google.Cloud.BigQuery.Storage.V1 (>= 3.17.0)
- Google.Cloud.BigQuery.V2 (>= 3.11.0)
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.0
- Apache.Arrow.Adbc (>= 0.20.0)
- Google.Cloud.BigQuery.Storage.V1 (>= 3.17.0)
- Google.Cloud.BigQuery.V2 (>= 3.11.0)
- System.Net.Http.WinHttpHandler (>= 8.0.3)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Apache.Arrow.Adbc (>= 0.20.0)
- Google.Cloud.BigQuery.Storage.V1 (>= 3.17.0)
- Google.Cloud.BigQuery.V2 (>= 3.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.