# Google BigQuery v2 API - Class QueryOptions (3.12.0)

3.12.0 (latest) 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.4.0 2.3.0 2.2.0

    public sealed class QueryOptions : JobCreationOptions

Reference documentation and code samples for the Google BigQuery v2 API class QueryOptions.

Options for `CreateQueryJob` and `ExecuteQuery` operations.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [JobCreationOptions](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions) \> QueryOptions

## Inherited Members

[JobCreationOptions.ProjectId](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_ProjectId) [JobCreationOptions.JobIdPrefix](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_JobIdPrefix) [JobCreationOptions.JobId](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_JobId) [JobCreationOptions.JobLocation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_JobLocation) [JobCreationOptions.Labels](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_Labels) [JobCreationOptions.JobConfigurationModifier](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationOptions#Google_Cloud_BigQuery_V2_JobCreationOptions_JobConfigurationModifier) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BigQuery.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2)

## Assembly

Google.Cloud.BigQuery.V2.dll

## Properties

### AllowLargeResults

    public bool? AllowLargeResults { get; set; }

If true, allows the query to produce arbitrarily large result sets at a slight cost
in performance. [DestinationTable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_DestinationTable) must be set in order to use this option.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### ConfigurationModifier

    public Action<JobConfigurationQuery> ConfigurationModifier { get; set; }

Optional action to perform after preparing the request. If this property is non-null,
the [JobConfigurationQuery](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.JobConfigurationQuery.html) used for a request will be passed to the delegate
before the request is executed. This allows for fine-grained modifications which aren't
otherwise directly supported by the properties in this options type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.action-1https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.JobConfigurationQuery.html` |   |

**Remarks** Prefer the properties on this type over this modifier to prepare the request.
Only use this modifier to configure aspects for which there are no properties available.
This modifier is applied to the request after all properties on this type have been applied.
The delegate is only called once per operation, even if the request is automatically retried.

### CreateDisposition

    public CreateDisposition? CreateDisposition { get; set; }

Specifies whether the operation is allowed to create new tables.
If not set, this is effectively [CreateIfNeeded](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateDisposition#Google_Cloud_BigQuery_V2_CreateDisposition_CreateIfNeeded).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateDisposition` |   |

### DefaultDataset

    public DatasetReference DefaultDataset { get; set; }

The default dataset to assume for any unqualified table names in the query.
If this is not set, all table names must be fully qualified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.DatasetReference.html` |   |

### DestinationEncryptionConfiguration

    public EncryptionConfiguration DestinationEncryptionConfiguration { get; set; }

The encryption configuratoin to apply to the destination table, if any.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.EncryptionConfiguration.html` |   |

### DestinationSchemaUpdateOptions

    public SchemaUpdateOption? DestinationSchemaUpdateOptions { get; set; }

Allows the schema of the [DestinationTable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_DestinationTable) to be updated as a side effect
of the query job.
Schema update options are supported in two cases:
when [WriteDisposition](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_WriteDisposition) is [WriteAppend](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.WriteDisposition#Google_Cloud_BigQuery_V2_WriteDisposition_WriteAppend);
when [WriteDisposition](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_WriteDisposition) is [WriteTruncate](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.WriteDisposition#Google_Cloud_BigQuery_V2_WriteDisposition_WriteTruncate)
and the destination table is a partition of a table, specified by partition decorators.
[SchemaUpdateOption](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.SchemaUpdateOption) is marked with the [FlagsAttribute](https://learn.microsoft.com/dotnet/api/system.flagsattribute)
so several flags can be specified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.SchemaUpdateOption` |   |

### DestinationTable

    public TableReference DestinationTable { get; set; }

A destination table to write the results into.
If this is not specified, the results will be stored in a temporary table.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.TableReference.html` |   |

### DryRun

    public bool? DryRun { get; set; }

If set to true, don't actually run this job. A valid query will return a mostly empty response
with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run.
This option can be used to determine the schema of the query without running it. The resulting
[BigQueryJob](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryJob) has no job ID, so cannot be polled for completion, but the [Resource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryJob#Google_Cloud_BigQuery_V2_BigQueryJob_Resource)
contains all the information returned by the server.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### FlattenResults

    public bool? FlattenResults { get; set; }

Flattens all nested and repeated fields in the query results.
If not set, this is effectively true. If this is set to false,
[DestinationTable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_DestinationTable) must be specified and [AllowLargeResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_AllowLargeResults)
must be set to true.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### JobCreationMode

    public JobCreationMode? JobCreationMode { get; set; }

Specifies whether a job is required to be created

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.JobCreationMode` |   |

### MaximumBillingTier

    public int? MaximumBillingTier { get; set; }

Limits the billing tier of the job. If the query uses resources beyond this tier,
it will fail.
If not set, this is effectively the project default.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### MaximumBytesBilled

    public long? MaximumBytesBilled { get; set; }

Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge).
If not set, this is effectively the project default.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### ParameterMode

    public BigQueryParameterMode? ParameterMode { get; set; }

If set, determines whether parameters are named or positional. If not set,
this will default to named parameters. When named parameters are used, all parameters
must have a name. When positional parameters are used, parameters may still have names,
but don't have to.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryParameterMode` |   |

### Priority

    public QueryPriority? Priority { get; set; }

The priority of the query.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryPriority` |   |

### TimePartitioning

    public TimePartitioning TimePartitioning { get; set; }

The time partitioning to apply, if any. See [TimePartition](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.TimePartition) to create instances of [TimePartitioning](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.QueryOptions#Google_Cloud_BigQuery_V2_QueryOptions_TimePartitioning).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.TimePartitioning.html` |   |

### UseLegacySql

    public bool? UseLegacySql { get; set; }

Set to true to use legacy SQL instead of standard SQL.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### UseQueryCache

    public bool? UseQueryCache { get; set; }

Whether to look for the result in the query cache.
If not set, this is effectively true.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### WriteDisposition

    public WriteDisposition? WriteDisposition { get; set; }

Specifies the behavior if the destination table exists.
If not set, this is effectively [WriteIfEmpty](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.WriteDisposition#Google_Cloud_BigQuery_V2_WriteDisposition_WriteIfEmpty).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.WriteDisposition` |   |