Class BigQueryClient (2.2.0)

public abstract class BigQueryClient : IDisposable

Abstract class providing operations for Google Cloud BigQuery.

Inheritance

Object > BigQueryClient

Implements

IDisposable

Derived Types

Namespace

Google.Cloud.BigQuery.V2

Assembly

Google.Cloud.BigQuery.V2.dll

Remarks

This abstract class is provided to enable testability while permitting additional operations to be added in the future. See Create(String, GoogleCredential) and CreateAsync(String, GoogleCredential) to construct instances; alternatively, you can construct a BigQueryClientImpl directly from a Google.Apis.Bigquery.v2.BigqueryService.

All instance methods declared in this class are virtual, with an implementation which simply throws NotImplementedException. All these methods are overridden in BigQueryClientImpl.

This class implements IDisposable; however, the Dispose() method only requires calling if many short-lived instances of BigQueryClient are being created. Most code would be expected to create a single BigQueryClient instance, and use this instance throughout the lifetime of the application. In this case, Dispose need not be called.

Properties

DefaultLocation

public virtual string DefaultLocation { get; }

The default location to use for all operations where locations can be specified, such as dataset and job creation.

Property Value
TypeDescription
String

PrettyPrint

public virtual bool PrettyPrint { get; }

Determines whether or not responses should be formatted with whitespace for readability.

Property Value
TypeDescription
Boolean

ProjectId

public virtual string ProjectId { get; }

The ID of the project this client operates on. All operations that require a project to be specified implicitly supply this ID.

Property Value
TypeDescription
String

Service

public virtual BigqueryService Service { get; }

The underlying BigQuery service object used by this client.

Property Value
TypeDescription
Google.Apis.Bigquery.v2.BigqueryService
Remarks

The BigQueryClient class only provides convenience operations built on top of an existing service object. Any more complex operations which are not supported by this wrapper may wish to use the same service object as the wrapper, in order to take advantage of its configuration (for authentication, application naming etc).

Methods

CancelJob(JobReference, CancelJobOptions)

public virtual BigQueryJob CancelJob(JobReference jobReference, CancelJobOptions options = null)

Cancels the specified job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The final state of the job.

Example

See CancelJob for an example using an alternative overload.

CancelJob(String, CancelJobOptions)

public virtual BigQueryJob CancelJob(string jobId, CancelJobOptions options = null)

Cancels the specified job within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to CancelJob(JobReference, CancelJobOptions).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The final state of the job.

Example
// Just an example of a job: extracting data to Google Cloud Storage.
BigQueryClient client = BigQueryClient.Create(projectId);
string destinationUri = $"gs://{bucket}/{objectName}";

// Start the job running...
BigQueryJob job = client.CreateExtractJob(projectId, datasetId, tableId, destinationUri);

// Now cancel it by ID. (Equivalent to calling job.Cancel().)
string jobId = job.Reference.JobId;
BigQueryJob canceledJob = client.CancelJob(jobId);
Console.WriteLine(canceledJob.State);

CancelJob(String, String, CancelJobOptions)

public virtual BigQueryJob CancelJob(string projectId, string jobId, CancelJobOptions options = null)

Cancels the specified job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to CancelJob(JobReference, CancelJobOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The final state of the job.

Example

See CancelJob for an example using an alternative overload.

CancelJobAsync(JobReference, CancelJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CancelJobAsync(JobReference jobReference, CancelJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously cancels the specified job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the final state of the job.

Example

See CancelJob for a synchronous example.

CancelJobAsync(String, CancelJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CancelJobAsync(string jobId, CancelJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously cancels the specified job within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to CancelJobAsync(JobReference, CancelJobOptions, CancellationToken).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the final state of the job.

Example

See CancelJob for a synchronous example.

CancelJobAsync(String, String, CancelJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CancelJobAsync(string projectId, string jobId, CancelJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously cancels the specified job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to CancelJobAsync(JobReference, CancelJobOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsCancelJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the final state of the job.

Example

See CancelJob for a synchronous example.

ClearDatasetLabels(DatasetReference, ModifyLabelsOptions)

public virtual IDictionary<string, string> ClearDatasetLabels(DatasetReference datasetReference, ModifyLabelsOptions options = null)

Clears all labels on the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
IDictionary<String, String>

A dictionary with the labels on the dataset before they were cleared.

Example

See ClearDatasetLabels for an example using an alternative overload.

ClearDatasetLabels(String, ModifyLabelsOptions)

public virtual IDictionary<string, string> ClearDatasetLabels(string datasetId, ModifyLabelsOptions options = null)

Clears all labels on the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to ClearDatasetLabels(DatasetReference, ModifyLabelsOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
IDictionary<String, String>

A dictionary with the labels on the dataset before they were cleared.

Example
BigQueryClient client = BigQueryClient.Create(projectId);

IDictionary<string, string> previousLabels = client.ClearDatasetLabels(datasetId);
Console.WriteLine("Previous labels:");
foreach (KeyValuePair<string, string> label in previousLabels)
{
    Console.WriteLine($"Name: {label.Key}; Value: {label.Value}");
}

ClearDatasetLabels(String, String, ModifyLabelsOptions)

public virtual IDictionary<string, string> ClearDatasetLabels(string projectId, string datasetId, ModifyLabelsOptions options = null)

Clears all labels on the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to ClearDatasetLabels(DatasetReference, ModifyLabelsOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
IDictionary<String, String>

A dictionary with the labels on the dataset before they were cleared.

Example

See ClearDatasetLabels for an example using an alternative overload.

ClearDatasetLabelsAsync(DatasetReference, ModifyLabelsOptions, CancellationToken)

public virtual Task<IDictionary<string, string>> ClearDatasetLabelsAsync(DatasetReference datasetReference, ModifyLabelsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously clears all labels on the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<IDictionary<String, String>>

A task representing the asynchronous operation. When complete, the result is a dictionary with the labels on the dataset before they were cleared.

Example

See ClearDatasetLabels for a synchronous example.

ClearDatasetLabelsAsync(String, ModifyLabelsOptions, CancellationToken)

public virtual Task<IDictionary<string, string>> ClearDatasetLabelsAsync(string datasetId, ModifyLabelsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously clears all labels on the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to ClearDatasetLabelsAsync(DatasetReference, ModifyLabelsOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<IDictionary<String, String>>

A task representing the asynchronous operation. When complete, the result is a dictionary with the labels on the dataset before they were cleared.

Example

See ClearDatasetLabels for a synchronous example.

ClearDatasetLabelsAsync(String, String, ModifyLabelsOptions, CancellationToken)

public virtual Task<IDictionary<string, string>> ClearDatasetLabelsAsync(string projectId, string datasetId, ModifyLabelsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously clears all labels on the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to ClearDatasetLabelsAsync(DatasetReference, ModifyLabelsOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsModifyLabelsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<IDictionary<String, String>>

A task representing the asynchronous operation. When complete, the result is a dictionary with the labels on the dataset before they were cleared.

Example

See ClearDatasetLabels for a synchronous example.

Create(String, GoogleCredential)

public static BigQueryClient Create(string projectId, GoogleCredential credential = null)

Synchronously creates a BigQueryClient, using application default credentials if no credentials are specified.

Parameters
NameDescription
projectIdString

The ID of the project containing the BigQuery data. Must not be null.

credentialGoogleCredential

Optional GoogleCredential.

Returns
TypeDescription
BigQueryClient

The created BigQueryClient.

Remarks

If the supplied credentials support scoping, the following scopes are specified, overwriting any previously-specified scopes.

If you require a different set of scopes, please create and scope the credential, then use BigQueryClientBuilder, specify the Credential and ProjectId properties, then call Build() to create the client.

CreateAsync(String, GoogleCredential)

public static Task<BigQueryClient> CreateAsync(string projectId, GoogleCredential credential = null)

Asynchronously creates a BigQueryClient, using application default credentials if no credentials are specified.

Parameters
NameDescription
projectIdString

The ID of the project containing the BigQuery data. Must not be null.

credentialGoogleCredential

Optional GoogleCredential.

Returns
TypeDescription
Task<BigQueryClient>

The task representing the created BigQueryClient.

Remarks

If the supplied credentials support scoping, the following scopes are specified, overwriting any previously-specified scopes.

If you require a different set of scopes, please create and scope the credential, then use BigQueryClientBuilder, specify the Credential and ProjectId properties, then call Build() to create the client.

CreateCopyJob(TableReference, TableReference, CreateCopyJobOptions)

public virtual BigQueryJob CreateCopyJob(TableReference source, TableReference destination, CreateCopyJobOptions options = null)

Creates a job to copy one table to another. This method creates a single-element array and delegates to CreateCopyJob(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions).

Parameters
NameDescription
sourceGoogle.Apis.Bigquery.v2.Data.TableReference

The source table to copy. Must not be null.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination to copy to. Must not be null.

optionsCreateCopyJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the copy operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableReference sourceTableReference = client.GetTableReference(datasetId, sourceTableId);
TableReference destinationTableReference = client.GetTableReference(datasetId, destinationTableId);

BigQueryJob job = client.CreateCopyJob(sourceTableReference, destinationTableReference)
    .PollUntilCompleted();
// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}

CreateCopyJob(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions)

public virtual BigQueryJob CreateCopyJob(IEnumerable<TableReference> sources, TableReference destination, CreateCopyJobOptions options = null)

Creates a job to copy data from at least one table to another.

Parameters
NameDescription
sourcesIEnumerable<Google.Apis.Bigquery.v2.Data.TableReference>

The source tables to copy. Must not be null or empty.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination to copy to. Must not be null.

optionsCreateCopyJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the copy operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example

See CreateCopyJob for an example using an alternative overload.

CreateCopyJobAsync(TableReference, TableReference, CreateCopyJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateCopyJobAsync(TableReference source, TableReference destination, CreateCopyJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to copy one table to another. This method creates a single-element array and delegates to CreateCopyJobAsync(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions, CancellationToken).

Parameters
NameDescription
sourceGoogle.Apis.Bigquery.v2.Data.TableReference

The source table to copy. Must not be null.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination to copy to. Must not be null.

optionsCreateCopyJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the copy operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableReference sourceTableReference = client.GetTableReference(datasetId, sourceTableId);
TableReference destinationTableReference = client.GetTableReference(datasetId, destinationTableId);

BigQueryJob job = await client.CreateCopyJobAsync(sourceTableReference, destinationTableReference);
job = await job.PollUntilCompletedAsync();

// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}

CreateCopyJobAsync(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateCopyJobAsync(IEnumerable<TableReference> sources, TableReference destination, CreateCopyJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to copy data from at least one table to another.

Parameters
NameDescription
sourcesIEnumerable<Google.Apis.Bigquery.v2.Data.TableReference>

The source tables to copy. Must not be null or empty.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination to copy to. Must not be null.

optionsCreateCopyJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the copy operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example

See CreateCopyJob for an example using an alternative overload.

CreateDataset(DatasetReference, Dataset, CreateDatasetOptions)

public virtual BigQueryDataset CreateDataset(DatasetReference datasetReference, Dataset resource = null, CreateDatasetOptions options = null)

Creates the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See CreateDataset for an example using an alternative overload.

CreateDataset(String, Dataset, CreateDatasetOptions)

public virtual BigQueryDataset CreateDataset(string datasetId, Dataset resource = null, CreateDatasetOptions options = null)

Creates the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to CreateDataset(DatasetReference, Dataset, CreateDatasetOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryDataset dataset = client.CreateDataset(datasetId);
// Now populate tables in the dataset...

CreateDataset(String, String, Dataset, CreateDatasetOptions)

public virtual BigQueryDataset CreateDataset(string projectId, string datasetId, Dataset resource = null, CreateDatasetOptions options = null)

Creates the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to CreateDataset(DatasetReference, Dataset, CreateDatasetOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See CreateDataset for an example using an alternative overload.

CreateDatasetAsync(DatasetReference, Dataset, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> CreateDatasetAsync(DatasetReference datasetReference, Dataset resource = null, CreateDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See CreateDataset for an example using an alternative overload.

CreateDatasetAsync(String, Dataset, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> CreateDatasetAsync(string datasetId, Dataset resource = null, CreateDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to CreateDatasetAsync(DatasetReference, Dataset, CreateDatasetOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
BigQueryDataset dataset = await client.CreateDatasetAsync(datasetId);
// Now populate tables in the dataset...

CreateDatasetAsync(String, String, Dataset, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> CreateDatasetAsync(string projectId, string datasetId, Dataset resource = null, CreateDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to CreateDatasetAsync(DatasetReference, Dataset, CreateDatasetOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

optionsCreateDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the created dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See CreateDataset for an example using an alternative overload.

CreateExtractJob(TableReference, IEnumerable<String>, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(TableReference tableReference, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example

See CreateExtractJob for an example using an alternative overload.

CreateExtractJob(TableReference, String, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(TableReference tableReference, string destinationUri, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table to Google Cloud Storage. This method just creates a single-element array and delegates to CreateExtractJob(TableReference, IEnumerable<String>, CreateExtractJobOptions). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example

See CreateExtractJob for an example using an alternative overload.

CreateExtractJob(String, String, IEnumerable<String>, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(string datasetId, string tableId, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJob(TableReference, IEnumerable<String>, CreateExtractJobOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example

See CreateExtractJob for an example using an alternative overload.

CreateExtractJob(String, String, String, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table within this client's project to Google Cloud Storage. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJob(TableReference, String, CreateExtractJobOptions). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example

See CreateExtractJob for an example using an alternative overload.

CreateExtractJob(String, String, String, IEnumerable<String>, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(string projectId, string datasetId, string tableId, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJob(TableReference, IEnumerable<String>, CreateExtractJobOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example

See CreateExtractJob for an example using an alternative overload.

CreateExtractJob(String, String, String, String, CreateExtractJobOptions)

public virtual BigQueryJob CreateExtractJob(string projectId, string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null)

Creates a job to extract data from the specified BigQuery table to Google Cloud Storage. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJob(TableReference, String, CreateExtractJobOptions). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
string destinationUri = $"gs://{bucket}/{objectName}";

BigQueryJob job = client.CreateExtractJob(projectId, datasetId, tableId, destinationUri)
    .PollUntilCompleted();
// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}
else
{
    StorageClient storageClient = StorageClient.Create();
    var obj = storageClient.GetObject(bucket, objectName);
    Console.WriteLine($"Extracted file size: {obj.Size}");
}

CreateExtractJobAsync(TableReference, IEnumerable<String>, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(TableReference tableReference, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example

See CreateExtractJobAsync for an example using an alternative overload.

CreateExtractJobAsync(TableReference, String, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(TableReference tableReference, string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage. This method just creates a single-element array and delegates to CreateExtractJobAsync(TableReference, IEnumerable<String>, CreateExtractJobOptions, CancellationToken). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example

See CreateExtractJobAsync for an example using an alternative overload.

CreateExtractJobAsync(String, String, IEnumerable<String>, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(string datasetId, string tableId, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJobAsync(TableReference, IEnumerable<String>, CreateExtractJobOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example

See CreateExtractJobAsync for an example using an alternative overload.

CreateExtractJobAsync(String, String, String, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table within this client's project to Google Cloud Storage. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJobAsync(TableReference, String, CreateExtractJobOptions, CancellationToken). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example

See CreateExtractJobAsync for an example using an alternative overload.

CreateExtractJobAsync(String, String, String, IEnumerable<String>, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(string projectId, string datasetId, string tableId, IEnumerable<string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage. See the BigQuery documentation for more information on extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJobAsync(TableReference, IEnumerable<String>, CreateExtractJobOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example

See CreateExtractJobAsync for an example using an alternative overload.

CreateExtractJobAsync(String, String, String, String, CreateExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateExtractJobAsync(string projectId, string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJobAsync(TableReference, String, CreateExtractJobOptions, CancellationToken). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.

optionsCreateExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
string destinationUri = $"gs://{bucket}/{objectName}";

BigQueryJob job = await client.CreateExtractJobAsync(projectId, datasetId, tableId, destinationUri);
job = await job.PollUntilCompletedAsync();
// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}
else
{
    StorageClient storageClient = StorageClient.Create();
    var obj = storageClient.GetObject(bucket, objectName);
    Console.WriteLine($"Extracted file size: {obj.Size}");
}

CreateJsonSerializersSettings()

public static JsonSerializerSettings CreateJsonSerializersSettings()

Creates a set of Newtonsoft.Json.JsonSerializerSettings suitable for specifying in Google.Apis.Bigquery.v2.BigqueryService construction. The settings have Json.NET date parsing detection disabled.

Returns
TypeDescription
Newtonsoft.Json.JsonSerializerSettings

A suitable set of settings.

CreateLoadJob(IEnumerable<String>, TableReference, TableSchema, CreateLoadJobOptions)

public virtual BigQueryJob CreateLoadJob(IEnumerable<string> sourceUris, TableReference destination, TableSchema schema, CreateLoadJobOptions options = null)

Creates a job to load data from at least one Google Cloud Storage file to a BigQuery table.

Parameters
NameDescription
sourceUrisIEnumerable<String>

The Google Cloud Storage URIs of the files to load. Must not be null or empty.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination table to write data to. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the table. May be null if the load operation does not require a schema, such as if the table already exists, the data is being loaded from a Google Cloud Datastore backup, or if the options are set to autodetect the schema.

optionsCreateLoadJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the load operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example

See CreateLoadJob for an example using an alternative overload.

CreateLoadJob(String, TableReference, TableSchema, CreateLoadJobOptions)

public virtual BigQueryJob CreateLoadJob(string sourceUri, TableReference destination, TableSchema schema, CreateLoadJobOptions options = null)

Creates a job to load data from a Google Cloud Storage file to a BigQuery table. This method creates a single-element array and delegates to CreateLoadJob(IEnumerable<String>, TableReference, TableSchema, CreateLoadJobOptions).

Parameters
NameDescription
sourceUriString

The Google Cloud Storage URI of the file to load. Must not be null.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination table to write data to. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the table. May be null if the load operation does not require a schema, such as if the table already exists, the data is being loaded from a Google Cloud Datastore backup, or if the options are set to autodetect the schema.

optionsCreateLoadJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the load operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example
BigQueryClient client = BigQueryClient.Create(projectId);

// First extract the data to Google Cloud Storage...
// (This is just a convenient way of getting data into Google Cloud Storage
// to demonstrate a load job. If you only wanted to copy a table,
// you'd create a copy job instead.)
BigQueryTable table = client.GetTable(datasetId, originalTableId);
table.CreateExtractJob(objectUri).PollUntilCompleted().ThrowOnAnyError();

TableReference newTableReference = client.GetTableReference(datasetId, newTableId);

// Then load it back again, with the same schema.
// The extracted file will contain a header row: we need to skip it when loading.
CreateLoadJobOptions options = new CreateLoadJobOptions
{
    SkipLeadingRows = 1
};
BigQueryJob job = client.CreateLoadJob(objectUri, newTableReference, table.Schema, options).PollUntilCompleted();

// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}

CreateLoadJobAsync(IEnumerable<String>, TableReference, TableSchema, CreateLoadJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateLoadJobAsync(IEnumerable<string> sourceUris, TableReference destination, TableSchema schema, CreateLoadJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to load data from at least one Google Cloud Storage file to a BigQuery table.

Parameters
NameDescription
sourceUrisIEnumerable<String>

The Google Cloud Storage URIs of the files to load. Must not be null or empty.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination table to write data to. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the table. May be null if the load operation does not require a schema, such as if the table already exists, the data is being loaded from a Google Cloud Datastore backup, or if the options are set to autodetect the schema.

optionsCreateLoadJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the load operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example

See CreateLoadJob for an example using an alternative overload.

CreateLoadJobAsync(String, TableReference, TableSchema, CreateLoadJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateLoadJobAsync(string sourceUri, TableReference destination, TableSchema schema, CreateLoadJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to load data from a Google Cloud Storage file to a BigQuery table. This method creates a single-element array and delegates to CreateLoadJobAsync(IEnumerable<String>, TableReference, TableSchema, CreateLoadJobOptions, CancellationToken).

Parameters
NameDescription
sourceUriString

The Google Cloud Storage URI of the file to load. Must not be null.

destinationGoogle.Apis.Bigquery.v2.Data.TableReference

The destination table to write data to. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the table. May be null if the load operation does not require a schema, such as if the table already exists, the data is being loaded from a Google Cloud Datastore backup, or if the options are set to autodetect the schema.

optionsCreateLoadJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the load operation.

Remarks

To avoid confusion between source and destination tables, overloads are not provided that take the individual components of table references. Instead, use GetTableReference(String, String) or GetTableReference(String, String, String) to create table references.

Example
BigQueryClient client = BigQueryClient.Create(projectId);

// First extract the data to Google Cloud Storage...
// (This is just a convenient way of getting data into Google Cloud Storage
// to demonstrate a load job. If you only wanted to copy a table,
// you'd create a copy job instead.)
BigQueryTable table = await client.GetTableAsync(datasetId, originalTableId);
var extractJob = await table.CreateExtractJobAsync(objectUri);
extractJob = (await extractJob.PollUntilCompletedAsync()).ThrowOnAnyError();

TableReference newTableReference = client.GetTableReference(datasetId, newTableId);

// Then load it back again, with the same schema.
// The extracted file will contain a header row: we need to skip it when loading.
CreateLoadJobOptions options = new CreateLoadJobOptions
{
    SkipLeadingRows = 1
};
BigQueryJob job = await client.CreateLoadJobAsync(objectUri, newTableReference, table.Schema, options);
await job.PollUntilCompletedAsync();

// If there are any errors, display them.
if (job.Status.ErrorResult != null)
{
    foreach (ErrorProto error in job.Status.Errors)
    {
        Console.WriteLine(error.Message);
    }
}

CreateModelExtractJob(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(ModelReference modelReference, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(ModelReference, String, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(ModelReference modelReference, string destinationUri, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(String, String, IEnumerable<String>, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(string datasetId, string modelId, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJob(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(String, String, String, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(string datasetId, string modelId, string destinationUri, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJob(ModelReference, String, CreateModelExtractJobOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(String, String, String, IEnumerable<String>, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(string projectId, string datasetId, string modelId, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJob(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(String, String, String, String, CreateModelExtractJobOptions)

public virtual BigQueryJob CreateModelExtractJob(string projectId, string datasetId, string modelId, string destinationUri, CreateModelExtractJobOptions options = null)

Creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJob(ModelReference, String, CreateModelExtractJobOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The job created for the extract operation.

CreateModelExtractJobAsync(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(ModelReference modelReference, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(ModelReference, String, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(ModelReference modelReference, string destinationUri, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(String, String, IEnumerable<String>, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(string datasetId, string modelId, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(String, String, String, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(string datasetId, string modelId, string destinationUri, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, String, CreateModelExtractJobOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(String, String, String, IEnumerable<String>, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(string projectId, string datasetId, string modelId, IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, IEnumerable<String>, CreateModelExtractJobOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUrisIEnumerable<String>

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(String, String, String, String, CreateModelExtractJobOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateModelExtractJobAsync(string projectId, string datasetId, string modelId, string destinationUri, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job to extract the specified BigQuery model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, String, CreateModelExtractJobOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

destinationUriString

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

optionsCreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateQueryJob(String, IEnumerable<BigQueryParameter>, QueryOptions)

public virtual BigQueryJob CreateQueryJob(string sql, IEnumerable<BigQueryParameter> parameters, QueryOptions options = null)

Creates a job for a SQL query.

Parameters
NameDescription
sqlString

The SQL query. Must not be null.

parametersIEnumerable<BigQueryParameter>

The parameters for the query. May be null, which is equivalent to specifying an empty list of parameters. Must not contain null elements.

optionsQueryOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The query job created. Use GetQueryResults(JobReference, GetQueryResultsOptions) to retrieve the results of the query.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, historyTableId);
TableReference destination = client.GetTableReference(datasetId, queryTableId);
// If the destination table is not specified, the results will be stored in
// a temporary table.
BigQueryJob job = client.CreateQueryJob(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    null, // No parameters
    new QueryOptions { DestinationTable = destination });

// Wait for the job to complete.
job.PollUntilCompleted();

// Then we can fetch the results, either via the job or by accessing
// the destination table.
BigQueryResults result = client.GetQueryResults(job.Reference);
foreach (BigQueryRow row in result)
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
}

CreateQueryJobAsync(String, IEnumerable<BigQueryParameter>, QueryOptions, CancellationToken)

public virtual Task<BigQueryJob> CreateQueryJobAsync(string sql, IEnumerable<BigQueryParameter> parameters, QueryOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a job for a SQL query.

Parameters
NameDescription
sqlString

The SQL query. Must not be null.

parametersIEnumerable<BigQueryParameter>

The parameters for the query. May be null, which is equivalent to specifying an empty list of parameters. Must not contain null elements.

optionsQueryOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the query job created. Use GetQueryResultsAsync(JobReference, GetQueryResultsOptions, CancellationToken) to retrieve the results of the query.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
BigQueryTable table = await client.GetTableAsync(datasetId, historyTableId);
TableReference destination = client.GetTableReference(datasetId, queryTableId);
// If the destination table is not specified, the results will be stored in
// a temporary table.
BigQueryJob job = await client.CreateQueryJobAsync(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    null, // No parameters
    new QueryOptions { DestinationTable = destination });

// Wait for the job to complete.
await job.PollUntilCompletedAsync();

// Then we can fetch the results, either via the job or by accessing
// the destination table.
BigQueryResults result = await client.GetQueryResultsAsync(job.Reference);
await result.GetRowsAsync().ForEachAsync(row =>
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
});

CreateRoutine(RoutineReference, Routine, CreateRoutineOptions)

public virtual BigQueryRoutine CreateRoutine(RoutineReference routineReference, Routine resource, CreateRoutineOptions options = null)

Creates the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The newly created routine.

CreateRoutine(String, String, Routine, CreateRoutineOptions)

public virtual BigQueryRoutine CreateRoutine(string datasetId, string routineId, Routine resource, CreateRoutineOptions options = null)

Creates the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to CreateRoutine(RoutineReference, Routine, CreateRoutineOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The newly created routine.

CreateRoutine(String, String, String, Routine, CreateRoutineOptions)

public virtual BigQueryRoutine CreateRoutine(string projectId, string datasetId, string routineId, Routine resource, CreateRoutineOptions options = null)

Creates the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to CreateRoutine(RoutineReference, Routine, CreateRoutineOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The newly created routine.

CreateRoutineAsync(RoutineReference, Routine, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> CreateRoutineAsync(RoutineReference routineReference, Routine resource, CreateRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the newly created routine.

CreateRoutineAsync(String, String, Routine, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> CreateRoutineAsync(string datasetId, string routineId, Routine resource, CreateRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to CreateRoutineAsync(RoutineReference, Routine, CreateRoutineOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the newly created routine.

CreateRoutineAsync(String, String, String, Routine, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> CreateRoutineAsync(string projectId, string datasetId, string routineId, Routine resource, CreateRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to CreateRoutineAsync(RoutineReference, Routine, CreateRoutineOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the newly created routine.

CreateTable(TableReference, Table, CreateTableOptions)

public virtual BigQueryTable CreateTable(TableReference tableReference, Table resource, CreateTableOptions options = null)

Creates the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example

See CreateTable for an example using an alternative overload.

CreateTable(TableReference, TableSchema, CreateTableOptions)

public virtual BigQueryTable CreateTable(TableReference tableReference, TableSchema schema, CreateTableOptions options = null)

Creates the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example

See CreateTable for an example using an alternative overload.

CreateTable(String, String, Table, CreateTableOptions)

public virtual BigQueryTable CreateTable(string datasetId, string tableId, Table resource, CreateTableOptions options = null)

Creates the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTable(TableReference, Table, CreateTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example

See CreateTable for an example using an alternative overload.

CreateTable(String, String, TableSchema, CreateTableOptions)

public virtual BigQueryTable CreateTable(string datasetId, string tableId, TableSchema schema, CreateTableOptions options = null)

Creates the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTable(TableReference, TableSchema, CreateTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableSchema schema = new TableSchemaBuilder
{
    { "from_player", BigQueryDbType.String },
    { "to_player", BigQueryDbType.String },
    { "message", BigQueryDbType.String }
}.Build();
BigQueryTable table = client.CreateTable(datasetId, tableId, schema);
// Now populate the table with data...

CreateTable(String, String, String, Table, CreateTableOptions)

public virtual BigQueryTable CreateTable(string projectId, string datasetId, string tableId, Table resource, CreateTableOptions options = null)

Creates the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTable(TableReference, Table, CreateTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example

See CreateTable for an example using an alternative overload.

CreateTable(String, String, String, TableSchema, CreateTableOptions)

public virtual BigQueryTable CreateTable(string projectId, string datasetId, string tableId, TableSchema schema, CreateTableOptions options = null)

Creates the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTable(TableReference, TableSchema, CreateTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The newly created table.

Example

See CreateTable for an example using an alternative overload.

CreateTableAsync(TableReference, Table, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(TableReference tableReference, Table resource, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example

See CreateTableAsync for an example using an alternative overload.

CreateTableAsync(TableReference, TableSchema, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(TableReference tableReference, TableSchema schema, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example

See CreateTableAsync for an example using an alternative overload.

CreateTableAsync(String, String, Table, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(string datasetId, string tableId, Table resource, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTableAsync(TableReference, Table, CreateTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example

See CreateTableAsync for an example using an alternative overload.

CreateTableAsync(String, String, TableSchema, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(string datasetId, string tableId, TableSchema schema, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTableAsync(TableReference, TableSchema, CreateTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
TableSchema schema = new TableSchemaBuilder
{
    { "from_player", BigQueryDbType.String },
    { "to_player", BigQueryDbType.String },
    { "message", BigQueryDbType.String }
}.Build();
BigQueryTable table = await client.CreateTableAsync(datasetId, tableId, schema);
// Now populate the table with data...

CreateTableAsync(String, String, String, Table, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(string projectId, string datasetId, string tableId, Table resource, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTableAsync(TableReference, Table, CreateTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example

See CreateTableAsync for an example using an alternative overload.

CreateTableAsync(String, String, String, TableSchema, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> CreateTableAsync(string projectId, string datasetId, string tableId, TableSchema schema, CreateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateTableAsync(TableReference, TableSchema, CreateTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

optionsCreateTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the newly created table.

Example

See CreateTableAsync for an example using an alternative overload.

DeleteDataset(DatasetReference, DeleteDatasetOptions)

public virtual void DeleteDataset(DatasetReference datasetReference, DeleteDatasetOptions options = null)

Deletes the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example

See DeleteDataset for an example using an alternative overload.

DeleteDataset(String, DeleteDatasetOptions)

public virtual void DeleteDataset(string datasetId, DeleteDatasetOptions options = null)

Deletes the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to DeleteDataset(DatasetReference, DeleteDatasetOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
client.DeleteDataset(datasetId);

DeleteDataset(String, String, DeleteDatasetOptions)

public virtual void DeleteDataset(string projectId, string datasetId, DeleteDatasetOptions options = null)

Deletes the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to DeleteDataset(DatasetReference, DeleteDatasetOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example

See DeleteDataset for an example using an alternative overload.

DeleteDatasetAsync(DatasetReference, DeleteDatasetOptions, CancellationToken)

public virtual Task DeleteDatasetAsync(DatasetReference datasetReference, DeleteDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example

See DeleteDatasetAsync for an example using an alternative overload.

DeleteDatasetAsync(String, DeleteDatasetOptions, CancellationToken)

public virtual Task DeleteDatasetAsync(string datasetId, DeleteDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to DeleteDatasetAsync(DatasetReference, DeleteDatasetOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
await client.DeleteDatasetAsync(datasetId);

DeleteDatasetAsync(String, String, DeleteDatasetOptions, CancellationToken)

public virtual Task DeleteDatasetAsync(string projectId, string datasetId, DeleteDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to DeleteDatasetAsync(DatasetReference, DeleteDatasetOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsDeleteDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example

See DeleteDatasetAsync for an example using an alternative overload.

DeleteModel(ModelReference, DeleteModelOptions)

public virtual void DeleteModel(ModelReference modelReference, DeleteModelOptions options = null)

Deletes the specified model.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteModel(String, String, DeleteModelOptions)

public virtual void DeleteModel(string datasetId, string modelId, DeleteModelOptions options = null)

Deletes the specified model within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to DeleteModel(ModelReference, DeleteModelOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteModel(String, String, String, DeleteModelOptions)

public virtual void DeleteModel(string projectId, string datasetId, string modelId, DeleteModelOptions options = null)

Deletes the specified model. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to DeleteModel(ModelReference, DeleteModelOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteModelAsync(ModelReference, DeleteModelOptions, CancellationToken)

public virtual Task DeleteModelAsync(ModelReference modelReference, DeleteModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified model.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteModelAsync(String, String, DeleteModelOptions, CancellationToken)

public virtual Task DeleteModelAsync(string datasetId, string modelId, DeleteModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified model within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to DeleteModelAsync(ModelReference, DeleteModelOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteModelAsync(String, String, String, DeleteModelOptions, CancellationToken)

public virtual Task DeleteModelAsync(string projectId, string datasetId, string modelId, DeleteModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified model. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to DeleteModelAsync(ModelReference, DeleteModelOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsDeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteRoutine(RoutineReference, DeleteRoutineOptions)

public virtual void DeleteRoutine(RoutineReference routineReference, DeleteRoutineOptions options = null)

Deletes the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteRoutine(String, String, DeleteRoutineOptions)

public virtual void DeleteRoutine(string datasetId, string routineId, DeleteRoutineOptions options = null)

Deletes the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to DeleteRoutine(RoutineReference, DeleteRoutineOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteRoutine(String, String, String, DeleteRoutineOptions)

public virtual void DeleteRoutine(string projectId, string datasetId, string routineId, DeleteRoutineOptions options = null)

Deletes the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to DeleteRoutine(RoutineReference, DeleteRoutineOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken)

public virtual Task DeleteRoutineAsync(RoutineReference routineReference, DeleteRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteRoutineAsync(String, String, DeleteRoutineOptions, CancellationToken)

public virtual Task DeleteRoutineAsync(string datasetId, string routineId, DeleteRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteRoutineAsync(String, String, String, DeleteRoutineOptions, CancellationToken)

public virtual Task DeleteRoutineAsync(string projectId, string datasetId, string routineId, DeleteRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

DeleteTable(TableReference, DeleteTableOptions)

public virtual void DeleteTable(TableReference tableReference, DeleteTableOptions options = null)

Deletes the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example

See DeleteTable for an example using an alternative overload.

DeleteTable(String, String, DeleteTableOptions)

public virtual void DeleteTable(string datasetId, string tableId, DeleteTableOptions options = null)

Deletes the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to DeleteTable(TableReference, DeleteTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
client.DeleteTable(datasetId, tableId);

DeleteTable(String, String, String, DeleteTableOptions)

public virtual void DeleteTable(string projectId, string datasetId, string tableId, DeleteTableOptions options = null)

Deletes the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to DeleteTable(TableReference, DeleteTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Example

See DeleteTable for an example using an alternative overload.

DeleteTableAsync(TableReference, DeleteTableOptions, CancellationToken)

public virtual Task DeleteTableAsync(TableReference tableReference, DeleteTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example

See DeleteTableAsync for an example using an alternative overload.

DeleteTableAsync(String, String, DeleteTableOptions, CancellationToken)

public virtual Task DeleteTableAsync(string datasetId, string tableId, DeleteTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to DeleteTableAsync(TableReference, DeleteTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
await client.DeleteTableAsync(datasetId, tableId);

DeleteTableAsync(String, String, String, DeleteTableOptions, CancellationToken)

public virtual Task DeleteTableAsync(string projectId, string datasetId, string tableId, DeleteTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously deletes the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to DeleteTableAsync(TableReference, DeleteTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsDeleteTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Example

See DeleteTableAsync for an example using an alternative overload.

Dispose()

public virtual void Dispose()

Dispose of this instance. See the BigQueryClient remarks on when this should be called.

ExecuteQuery(String, IEnumerable<BigQueryParameter>, QueryOptions, GetQueryResultsOptions)

public virtual BigQueryResults ExecuteQuery(string sql, IEnumerable<BigQueryParameter> parameters, QueryOptions queryOptions = null, GetQueryResultsOptions resultsOptions = null)

Executes a query.

Parameters
NameDescription
sqlString

The SQL query. Must not be null.

parametersIEnumerable<BigQueryParameter>

The parameters for the query. May be null, which is equivalent to specifying an empty list of parameters. Must not contain null elements.

queryOptionsQueryOptions

The options for the query. May be null, in which case defaults will be supplied.

resultsOptionsGetQueryResultsOptions

The options for retrieving query results. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryResults

The result of the query.

Remarks

This method will only return when the query has completed. It simply delegates to CreateQueryJob(String, IEnumerable<BigQueryParameter>, QueryOptions) and then GetQueryResults(GetQueryResultsOptions).

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, historyTableId);
BigQueryResults result = client.ExecuteQuery(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    parameters: null);
foreach (BigQueryRow row in result)
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
}

ExecuteQueryAsync(String, IEnumerable<BigQueryParameter>, QueryOptions, GetQueryResultsOptions, CancellationToken)

public virtual Task<BigQueryResults> ExecuteQueryAsync(string sql, IEnumerable<BigQueryParameter> parameters, QueryOptions queryOptions = null, GetQueryResultsOptions resultsOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously executes a query.

Parameters
NameDescription
sqlString

The SQL query. Must not be null.

parametersIEnumerable<BigQueryParameter>

The parameters for the query. May be null, which is equivalent to specifying an empty list of parameters. Must not contain null elements.

queryOptionsQueryOptions

The options for the query. May be null, in which case defaults will be supplied.

resultsOptionsGetQueryResultsOptions

The options for retrieving query results. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryResults>

A task representing the asynchronous operation. When complete, the result is the BigQueryResults representing the query.

Remarks

The task returned by this method will only complete when the query has completed. This method simply delegates to CreateQueryJobAsync(String, IEnumerable<BigQueryParameter>, QueryOptions, CancellationToken) and then GetQueryResultsAsync(GetQueryResultsOptions, CancellationToken).

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
BigQueryTable table = await client.GetTableAsync(datasetId, historyTableId);
BigQueryResults result = await client.ExecuteQueryAsync(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    parameters: null);
await result.GetRowsAsync().ForEachAsync(row =>
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
});

GetBigQueryServiceAccountEmail(ProjectReference, GetBigQueryServiceAccountEmailOptions)

public virtual string GetBigQueryServiceAccountEmail(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null)

Retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service.

Parameters
NameDescription
projectReferenceGoogle.Apis.Bigquery.v2.Data.ProjectReference

A fully-qualified identifier for the project. Must not be null.

optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
String

The email address of the service account.

Example

See GetBigQueryServiceAccountEmail for an example using an alternative overload.

GetBigQueryServiceAccountEmail(GetBigQueryServiceAccountEmailOptions)

public virtual string GetBigQueryServiceAccountEmail(GetBigQueryServiceAccountEmailOptions options = null)

Retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to GetBigQueryServiceAccountEmail(ProjectReference, GetBigQueryServiceAccountEmailOptions).

Parameter
NameDescription
optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
String

The email address of the service account.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
string email = client.GetBigQueryServiceAccountEmail();
Console.WriteLine(email);

GetBigQueryServiceAccountEmail(String, GetBigQueryServiceAccountEmailOptions)

public virtual string GetBigQueryServiceAccountEmail(string projectId, GetBigQueryServiceAccountEmailOptions options = null)

Retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to GetBigQueryServiceAccountEmail(ProjectReference, GetBigQueryServiceAccountEmailOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
String

The email address of the service account.

Example

See GetBigQueryServiceAccountEmail for an example using an alternative overload.

GetBigQueryServiceAccountEmailAsync(ProjectReference, GetBigQueryServiceAccountEmailOptions, CancellationToken)

public virtual Task<string> GetBigQueryServiceAccountEmailAsync(ProjectReference projectReference, GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service.

Parameters
NameDescription
projectReferenceGoogle.Apis.Bigquery.v2.Data.ProjectReference

A fully-qualified identifier for the project. Must not be null.

optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<String>

A task representing the asynchronous operation. When complete, the result is the email address of the service account.

Example

See GetBigQueryServiceAccountEmail for a synchronous example.

GetBigQueryServiceAccountEmailAsync(GetBigQueryServiceAccountEmailOptions, CancellationToken)

public virtual Task<string> GetBigQueryServiceAccountEmailAsync(GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to GetBigQueryServiceAccountEmailAsync(ProjectReference, GetBigQueryServiceAccountEmailOptions, CancellationToken).

Parameters
NameDescription
optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<String>

A task representing the asynchronous operation. When complete, the result is the email address of the service account.

Example

See GetBigQueryServiceAccountEmail for a synchronous example.

GetBigQueryServiceAccountEmailAsync(String, GetBigQueryServiceAccountEmailOptions, CancellationToken)

public virtual Task<string> GetBigQueryServiceAccountEmailAsync(string projectId, GetBigQueryServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the service account email address that Google Cloud BigQuery uses for operations on other services such as the Google Cloud Key Management Service. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to GetBigQueryServiceAccountEmailAsync(ProjectReference, GetBigQueryServiceAccountEmailOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

optionsGetBigQueryServiceAccountEmailOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<String>

A task representing the asynchronous operation. When complete, the result is the email address of the service account.

Example

See GetBigQueryServiceAccountEmail for a synchronous example.

GetDataset(DatasetReference, GetDatasetOptions)

public virtual BigQueryDataset GetDataset(DatasetReference datasetReference, GetDatasetOptions options = null)

Retrieves the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The requested dataset.

Example

See GetDataset for an example using an alternative overload.

GetDataset(String, GetDatasetOptions)

public virtual BigQueryDataset GetDataset(string datasetId, GetDatasetOptions options = null)

Retrieves the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetDataset(DatasetReference, GetDatasetOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The requested dataset.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryDataset dataset = client.GetDataset(datasetId);
Console.WriteLine(dataset.FullyQualifiedId);

GetDataset(String, String, GetDatasetOptions)

public virtual BigQueryDataset GetDataset(string projectId, string datasetId, GetDatasetOptions options = null)

Retrieves the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetDataset(DatasetReference, GetDatasetOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The requested dataset.

Example

See GetDataset for an example using an alternative overload.

GetDatasetAsync(DatasetReference, GetDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetDatasetAsync(DatasetReference datasetReference, GetDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified dataset.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the requested dataset.

Example

See GetDataset for a synchronous example.

GetDatasetAsync(String, GetDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetDatasetAsync(string datasetId, GetDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified dataset within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetDatasetAsync(DatasetReference, GetDatasetOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the requested dataset.

Example

See GetDataset for a synchronous example.

GetDatasetAsync(String, String, GetDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetDatasetAsync(string projectId, string datasetId, GetDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified dataset. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetDatasetAsync(DatasetReference, GetDatasetOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

optionsGetDatasetOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the requested dataset.

Example

See GetDataset for a synchronous example.

GetDatasetReference(String)

public DatasetReference GetDatasetReference(string datasetId)

Creates a Google.Apis.Bigquery.v2.Data.DatasetReference from the given dataset ID, using this client's project ID.

Parameter
NameDescription
datasetIdString

The dataset ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.DatasetReference

A Google.Apis.Bigquery.v2.Data.DatasetReference representing the requested dataset.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
DatasetReference reference = client.GetDatasetReference("dataset");
// ProjectId is defaulted from the client in this overload
Console.WriteLine(reference.ProjectId);

GetDatasetReference(String, String)

public DatasetReference GetDatasetReference(string projectId, string datasetId)

Creates a Google.Apis.Bigquery.v2.Data.DatasetReference from the given project ID and dataset ID.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.DatasetReference

A Google.Apis.Bigquery.v2.Data.DatasetReference representing the requested dataset.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
DatasetReference reference = client.GetDatasetReference("other-project", "dataset");
// ProjectId is as specified in the call, not the client's project
Console.WriteLine(reference.ProjectId);

GetJob(JobReference, GetJobOptions)

public virtual BigQueryJob GetJob(JobReference jobReference, GetJobOptions options = null)

Retrieves the specified job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The retrieved job.

Example

See GetJob for an example using an alternative overload.

GetJob(String, GetJobOptions)

public virtual BigQueryJob GetJob(string jobId, GetJobOptions options = null)

Retrieves the specified job within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetJob(JobReference, GetJobOptions).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The retrieved job.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryJob job = client.GetJob(jobId);
Console.WriteLine(job.State);

GetJob(String, String, GetJobOptions)

public virtual BigQueryJob GetJob(string projectId, string jobId, GetJobOptions options = null)

Retrieves the specified job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetJob(JobReference, GetJobOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryJob

The retrieved job.

Example

See GetJob for an example using an alternative overload.

GetJobAsync(JobReference, GetJobOptions, CancellationToken)

public virtual Task<BigQueryJob> GetJobAsync(JobReference jobReference, GetJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the retrieved job.

Example

See GetJob for a synchronous example.

GetJobAsync(String, GetJobOptions, CancellationToken)

public virtual Task<BigQueryJob> GetJobAsync(string jobId, GetJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified job within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetJobAsync(JobReference, GetJobOptions, CancellationToken).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the retrieved job.

Example

See GetJob for a synchronous example.

GetJobAsync(String, String, GetJobOptions, CancellationToken)

public virtual Task<BigQueryJob> GetJobAsync(string projectId, string jobId, GetJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetJobAsync(JobReference, GetJobOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsGetJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryJob>

A task representing the asynchronous operation. When complete, the result is the retrieved job.

Example

See GetJob for a synchronous example.

GetJobReference(String)

public JobReference GetJobReference(string jobId)

Creates a Google.Apis.Bigquery.v2.Data.JobReference from the given job ID, using this client's project ID and default location.

Parameter
NameDescription
jobIdString

The job ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.JobReference

A Google.Apis.Bigquery.v2.Data.JobReference representing the requested job.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
JobReference reference = client.GetJobReference("job");
// ProjectId is defaulted from the client in this overload
Console.WriteLine(reference.ProjectId);

GetJobReference(String, String)

public JobReference GetJobReference(string projectId, string jobId)

Creates a Google.Apis.Bigquery.v2.Data.JobReference from the given project ID and job ID, using this client's default location.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.JobReference

A Google.Apis.Bigquery.v2.Data.JobReference representing the requested job.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
JobReference reference = client.GetJobReference("other-project", "job");
// ProjectId is as specified in the call, not the client's project
Console.WriteLine(reference.ProjectId);

GetJobReference(String, String, String)

public JobReference GetJobReference(string projectId, string jobId, string location)

Creates a Google.Apis.Bigquery.v2.Data.JobReference from the given project ID, job ID and location.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

locationString

The location. May be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.JobReference

A Google.Apis.Bigquery.v2.Data.JobReference representing the requested job.

GetModel(ModelReference, GetModelOptions)

public virtual BigQueryModel GetModel(ModelReference modelReference, GetModelOptions options = null)

Retrieves the specified model.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryModel

The requested model.

GetModel(String, String, GetModelOptions)

public virtual BigQueryModel GetModel(string datasetId, string modelId, GetModelOptions options = null)

Retrieves the specified model within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to GetModel(ModelReference, GetModelOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryModel

The requested model.

GetModel(String, String, String, GetModelOptions)

public virtual BigQueryModel GetModel(string projectId, string datasetId, string modelId, GetModelOptions options = null)

Retrieves the specified model. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to GetModel(ModelReference, GetModelOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryModel

The requested model.

GetModelAsync(ModelReference, GetModelOptions, CancellationToken)

public virtual Task<BigQueryModel> GetModelAsync(ModelReference modelReference, GetModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified model.

Parameters
NameDescription
modelReferenceGoogle.Apis.Bigquery.v2.Data.ModelReference

A fully-qualified identifier for the model. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryModel>

A task representing the asynchronous operation. When complete, the result is the requested model.

GetModelAsync(String, String, GetModelOptions, CancellationToken)

public virtual Task<BigQueryModel> GetModelAsync(string datasetId, string modelId, GetModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified model within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to GetModelAsync(ModelReference, GetModelOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryModel>

A task representing the asynchronous operation. When complete, the result is the requested model.

GetModelAsync(String, String, String, GetModelOptions, CancellationToken)

public virtual Task<BigQueryModel> GetModelAsync(string projectId, string datasetId, string modelId, GetModelOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified model. This method just creates a Google.Apis.Bigquery.v2.Data.ModelReference and delegates to GetModelAsync(ModelReference, GetModelOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

optionsGetModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryModel>

A task representing the asynchronous operation. When complete, the result is the requested model.

GetModelReference(String, String)

public ModelReference GetModelReference(string datasetId, string modelId)

Creates a Google.Apis.Bigquery.v2.Data.ModelReference from the given dataset ID and model ID, using this client's project ID.

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.ModelReference

A Google.Apis.Bigquery.v2.Data.ModelReference representing the requested model.

GetModelReference(String, String, String)

public ModelReference GetModelReference(string projectId, string datasetId, string modelId)

Creates a Google.Apis.Bigquery.v2.Data.ModelReference from the given project ID, dataset ID and model ID.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

modelIdString

The model ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.ModelReference

A Google.Apis.Bigquery.v2.Data.ModelReference representing the requested model.

GetOrCreateDataset(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions)

public virtual BigQueryDataset GetOrCreateDataset(DatasetReference datasetReference, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null)

Attempts to fetch the specified dataset, creating it if it doesn't exist.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See GetOrCreateDataset for an example using an alternative overload.

GetOrCreateDataset(String, Dataset, GetDatasetOptions, CreateDatasetOptions)

public virtual BigQueryDataset GetOrCreateDataset(string datasetId, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null)

Attempts to fetch the specified dataset within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetOrCreateDataset(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
// If the dataset isn't found, it will be created.
BigQueryDataset dataset = client.GetOrCreateDataset(datasetId);
// Now populate tables in the dataset...

GetOrCreateDataset(String, String, Dataset, GetDatasetOptions, CreateDatasetOptions)

public virtual BigQueryDataset GetOrCreateDataset(string projectId, string datasetId, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null)

Attempts to fetch the specified dataset, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetOrCreateDataset(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryDataset

The existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See GetOrCreateDataset for an example using an alternative overload.

GetOrCreateDatasetAsync(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetOrCreateDatasetAsync(DatasetReference datasetReference, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified dataset, creating it if it doesn't exist.

Parameters
NameDescription
datasetReferenceGoogle.Apis.Bigquery.v2.Data.DatasetReference

A fully-qualified identifier for the dataset. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See GetOrCreateDataset for an example using an alternative overload.

GetOrCreateDatasetAsync(String, Dataset, GetDatasetOptions, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetOrCreateDatasetAsync(string datasetId, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified dataset within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetOrCreateDatasetAsync(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
// If the dataset isn't found, it will be created.
BigQueryDataset dataset = await client.GetOrCreateDatasetAsync(datasetId);
// Now populate tables in the dataset...

GetOrCreateDatasetAsync(String, String, Dataset, GetDatasetOptions, CreateDatasetOptions, CancellationToken)

public virtual Task<BigQueryDataset> GetOrCreateDatasetAsync(string projectId, string datasetId, Dataset resource = null, GetDatasetOptions getOptions = null, CreateDatasetOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified dataset, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.DatasetReference and delegates to GetOrCreateDatasetAsync(DatasetReference, Dataset, GetDatasetOptions, CreateDatasetOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Dataset

The dataset resource representation to use for the creation. May be null in which case default values will be used.

getOptionsGetDatasetOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateDatasetOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryDataset>

A task representing the asynchronous operation. When complete, the result is the existing or new dataset.

Remarks

If resourceGoogle.Apis.Bigquery.v2.Data.Dataset.DatasetReference is specified, then it must be the same as the Google.Apis.Bigquery.v2.Data.DatasetReference obtained from the other parameters.

Example

See GetOrCreateDataset for an example using an alternative overload.

GetOrCreateRoutine(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions)

public virtual BigQueryRoutine GetOrCreateRoutine(RoutineReference routineReference, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null)

Attempts to fetch the specified routine, creating it if it doesn't exist.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The existing or new routine.

GetOrCreateRoutine(String, String, Routine, GetRoutineOptions, CreateRoutineOptions)

public virtual BigQueryRoutine GetOrCreateRoutine(string datasetId, string routineId, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null)

Attempts to fetch the specified routine within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetOrCreateRoutine(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The existing or new routine.

GetOrCreateRoutine(String, String, String, Routine, GetRoutineOptions, CreateRoutineOptions)

public virtual BigQueryRoutine GetOrCreateRoutine(string projectId, string datasetId, string routineId, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null)

Attempts to fetch the specified routine, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetOrCreateRoutine(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The existing or new routine.

GetOrCreateRoutineAsync(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetOrCreateRoutineAsync(RoutineReference routineReference, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified routine, creating it if it doesn't exist.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the existing or new routine.

GetOrCreateRoutineAsync(String, String, Routine, GetRoutineOptions, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetOrCreateRoutineAsync(string datasetId, string routineId, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified routine within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetOrCreateRoutineAsync(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the existing or new routine.

GetOrCreateRoutineAsync(String, String, String, Routine, GetRoutineOptions, CreateRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetOrCreateRoutineAsync(string projectId, string datasetId, string routineId, Routine resource, GetRoutineOptions getOptions = null, CreateRoutineOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified routine, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetOrCreateRoutineAsync(RoutineReference, Routine, GetRoutineOptions, CreateRoutineOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Routine

The routine resource representation to use for the creation. Must not be null. If this routine's Google.Apis.Bigquery.v2.Data.Routine.RoutineReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetRoutineOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateRoutineOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the existing or new routine.

GetOrCreateTable(TableReference, Table, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(TableReference tableReference, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table, creating it if it doesn't exist.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

GetOrCreateTable(TableReference, TableSchema, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(TableReference tableReference, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table, creating it if it doesn't exist.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

Example

See GetOrCreateTable for an example using an alternative overload.

GetOrCreateTable(String, String, Table, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(string datasetId, string tableId, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTable(TableReference, Table, GetTableOptions, CreateTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

Example

See GetOrCreateTable for an example using an alternative overload.

GetOrCreateTable(String, String, TableSchema, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(string datasetId, string tableId, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTable(TableReference, TableSchema, GetTableOptions, CreateTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableSchema schema = new TableSchemaBuilder
{
    { "from_player", BigQueryDbType.String },
    { "to_player", BigQueryDbType.String },
    { "message", BigQueryDbType.String }
}.Build();
// If the table isn't found, it will be created.
BigQueryTable table = client.GetOrCreateTable(datasetId, tableId, schema);
// Now populate the table with data...

GetOrCreateTable(String, String, String, Table, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(string projectId, string datasetId, string tableId, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTable(TableReference, Table, GetTableOptions, CreateTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

GetOrCreateTable(String, String, String, TableSchema, GetTableOptions, CreateTableOptions)

public virtual BigQueryTable GetOrCreateTable(string projectId, string datasetId, string tableId, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null)

Attempts to fetch the specified table, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTable(TableReference, TableSchema, GetTableOptions, CreateTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The existing or new table.

Example

See GetOrCreateTable for an example using an alternative overload.

GetOrCreateTableAsync(TableReference, Table, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(TableReference tableReference, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table, creating it if it doesn't exist.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example

See GetOrCreateTableAsync for an example using an alternative overload.

GetOrCreateTableAsync(TableReference, TableSchema, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(TableReference tableReference, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table, creating it if it doesn't exist.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example

See GetOrCreateTableAsync for an example using an alternative overload.

GetOrCreateTableAsync(String, String, Table, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(string datasetId, string tableId, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTableAsync(TableReference, Table, GetTableOptions, CreateTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example

See GetOrCreateTableAsync for an example using an alternative overload.

GetOrCreateTableAsync(String, String, TableSchema, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(string datasetId, string tableId, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table within this client's project, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTableAsync(TableReference, TableSchema, GetTableOptions, CreateTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
TableSchema schema = new TableSchemaBuilder
{
    { "from_player", BigQueryDbType.String },
    { "to_player", BigQueryDbType.String },
    { "message", BigQueryDbType.String }
}.Build();
// If the table isn't found, it will be created.
BigQueryTable table = await client.GetOrCreateTableAsync(datasetId, tableId, schema);
// Now populate the table with data...

GetOrCreateTableAsync(String, String, String, Table, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(string projectId, string datasetId, string tableId, Table resource, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTableAsync(TableReference, Table, GetTableOptions, CreateTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

resourceGoogle.Apis.Bigquery.v2.Data.Table

The table resource representation to use for the creation. Must not be null. If this table's Google.Apis.Bigquery.v2.Data.Table.TableReference is specified, then it must be the same as the one obtained from the other parameters, else it will be set to the one obtained from the other parameters.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example

See GetOrCreateTableAsync for an example using an alternative overload.

GetOrCreateTableAsync(String, String, String, TableSchema, GetTableOptions, CreateTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetOrCreateTableAsync(string projectId, string datasetId, string tableId, TableSchema schema, GetTableOptions getOptions = null, CreateTableOptions createOptions = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously attempts to fetch the specified table, creating it if it doesn't exist. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetOrCreateTableAsync(TableReference, TableSchema, GetTableOptions, CreateTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

schemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the new table. Must not be null.

getOptionsGetTableOptions

The options for the "get" operation. May be null, in which case defaults will be supplied.

createOptionsCreateTableOptions

The options for the "create" operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the existing or new table.

Example

See GetOrCreateTableAsync for an example using an alternative overload.

GetProjectReference(String)

public ProjectReference GetProjectReference(string projectId)

Creates a Google.Apis.Bigquery.v2.Data.ProjectReference from the given project ID.

Parameter
NameDescription
projectIdString

The project ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.ProjectReference

A Google.Apis.Bigquery.v2.Data.ProjectReference representing the requested project.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
ProjectReference reference = client.GetProjectReference("other-project");
Console.WriteLine(reference.ProjectId);

GetQueryResults(JobReference, GetQueryResultsOptions)

public virtual BigQueryResults GetQueryResults(JobReference jobReference, GetQueryResultsOptions options = null)

Retrieves the results of the specified job, which must be a query job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryResults

The results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, historyTableId);
TableReference destination = client.GetTableReference(datasetId, queryTableId);
// If the destination table is not specified, the results will be stored in
// a temporary table.
BigQueryJob job = client.CreateQueryJob(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    null, // No parameters
    new QueryOptions { DestinationTable = destination });

// Wait for the job to complete.
job.PollUntilCompleted();

// Then we can fetch the results, either via the job or by accessing
// the destination table.
BigQueryResults result = client.GetQueryResults(job.Reference);
foreach (BigQueryRow row in result)
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
}

GetQueryResults(String, GetQueryResultsOptions)

public virtual BigQueryResults GetQueryResults(string jobId, GetQueryResultsOptions options = null)

Retrieves the results of the specified job within this client's project, which must be a query job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetQueryResults(JobReference, GetQueryResultsOptions).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryResults

The results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example

See GetQueryResults for an example using an alternative overload.

GetQueryResults(String, String, GetQueryResultsOptions)

public virtual BigQueryResults GetQueryResults(string projectId, string jobId, GetQueryResultsOptions options = null)

Retrieves the results of the specified job, which must be a query job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetQueryResults(JobReference, GetQueryResultsOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryResults

The results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example

See GetQueryResults for an example using an alternative overload.

GetQueryResultsAsync(JobReference, GetQueryResultsOptions, CancellationToken)

public virtual Task<BigQueryResults> GetQueryResultsAsync(JobReference jobReference, GetQueryResultsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the results of the specified job, which must be a query job.

Parameters
NameDescription
jobReferenceGoogle.Apis.Bigquery.v2.Data.JobReference

A fully-qualified identifier for the job. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryResults>

A task representing the asynchronous operation. When complete, the result is the results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
BigQueryTable table = await client.GetTableAsync(datasetId, historyTableId);
TableReference destination = client.GetTableReference(datasetId, queryTableId);
// If the destination table is not specified, the results will be stored in
// a temporary table.
BigQueryJob job = await client.CreateQueryJobAsync(
    $@"SELECT player, MAX(score) AS score
       FROM {table}
       GROUP BY player
       ORDER BY score DESC",
    null, // No parameters
    new QueryOptions { DestinationTable = destination });

// Wait for the job to complete.
await job.PollUntilCompletedAsync();

// Then we can fetch the results, either via the job or by accessing
// the destination table.
BigQueryResults result = await client.GetQueryResultsAsync(job.Reference);
await result.GetRowsAsync().ForEachAsync(row =>
{
    Console.WriteLine($"{row["player"]}: {row["score"]}");
});

GetQueryResultsAsync(String, GetQueryResultsOptions, CancellationToken)

public virtual Task<BigQueryResults> GetQueryResultsAsync(string jobId, GetQueryResultsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the results of the specified job within this client's project, which must be a query job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetQueryResultsAsync(JobReference, GetQueryResultsOptions, CancellationToken).

Parameters
NameDescription
jobIdString

The job ID. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryResults>

A task representing the asynchronous operation. When complete, the result is the results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example

See GetQueryResults for an example using an alternative overload.

GetQueryResultsAsync(String, String, GetQueryResultsOptions, CancellationToken)

public virtual Task<BigQueryResults> GetQueryResultsAsync(string projectId, string jobId, GetQueryResultsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the results of the specified job, which must be a query job. This method just creates a Google.Apis.Bigquery.v2.Data.JobReference and delegates to GetQueryResultsAsync(JobReference, GetQueryResultsOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

jobIdString

The job ID. Must not be null.

optionsGetQueryResultsOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryResults>

A task representing the asynchronous operation. When complete, the result is the results of the query.

Remarks

This operation will only complete when the specified query has completed.

Example

See GetQueryResults for an example using an alternative overload.

GetRoutine(RoutineReference, GetRoutineOptions)

public virtual BigQueryRoutine GetRoutine(RoutineReference routineReference, GetRoutineOptions options = null)

Retrieves the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The requested routine.

GetRoutine(String, String, GetRoutineOptions)

public virtual BigQueryRoutine GetRoutine(string datasetId, string routineId, GetRoutineOptions options = null)

Retrieves the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetRoutine(RoutineReference, GetRoutineOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The requested routine.

GetRoutine(String, String, String, GetRoutineOptions)

public virtual BigQueryRoutine GetRoutine(string projectId, string datasetId, string routineId, GetRoutineOptions options = null)

Retrieves the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetRoutine(RoutineReference, GetRoutineOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The requested routine.

GetRoutineAsync(RoutineReference, GetRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetRoutineAsync(RoutineReference routineReference, GetRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified routine.

Parameters
NameDescription
routineReferenceGoogle.Apis.Bigquery.v2.Data.RoutineReference

A fully-qualified identifier for the routine. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the requested routine.

GetRoutineAsync(String, String, GetRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetRoutineAsync(string datasetId, string routineId, GetRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified routine within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetRoutineAsync(RoutineReference, GetRoutineOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the requested routine.

GetRoutineAsync(String, String, String, GetRoutineOptions, CancellationToken)

public virtual Task<BigQueryRoutine> GetRoutineAsync(string projectId, string datasetId, string routineId, GetRoutineOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified routine. This method just creates a Google.Apis.Bigquery.v2.Data.RoutineReference and delegates to GetRoutineAsync(RoutineReference, GetRoutineOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

optionsGetRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryRoutine>

A task representing the asynchronous operation. When complete, the result is the requested routine.

GetRoutineReference(String, String)

public RoutineReference GetRoutineReference(string datasetId, string routineId)

Creates a Google.Apis.Bigquery.v2.Data.RoutineReference from the given dataset ID and routine ID, using this client's project ID.

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.RoutineReference

A Google.Apis.Bigquery.v2.Data.RoutineReference representing the requested routine.

GetRoutineReference(String, String, String)

public RoutineReference GetRoutineReference(string projectId, string datasetId, string routineId)

Creates a Google.Apis.Bigquery.v2.Data.RoutineReference from the given project ID, dataset ID and routine ID.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

routineIdString

The routine ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.RoutineReference

A Google.Apis.Bigquery.v2.Data.RoutineReference representing the requested routine.

GetTable(TableReference, GetTableOptions)

public virtual BigQueryTable GetTable(TableReference tableReference, GetTableOptions options = null)

Retrieves the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The requested table.

Example

See GetTable for an example using an alternative overload.

GetTable(String, String, GetTableOptions)

public virtual BigQueryTable GetTable(string datasetId, string tableId, GetTableOptions options = null)

Retrieves the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetTable(TableReference, GetTableOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The requested table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, tableId);
Console.WriteLine(table.FullyQualifiedId);

GetTable(String, String, String, GetTableOptions)

public virtual BigQueryTable GetTable(string projectId, string datasetId, string tableId, GetTableOptions options = null)

Retrieves the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetTable(TableReference, GetTableOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryTable

The requested table.

Example

See GetTable for an example using an alternative overload.

GetTableAsync(TableReference, GetTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetTableAsync(TableReference tableReference, GetTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the requested table.

Example

See GetTable for a synchronous example.

GetTableAsync(String, String, GetTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetTableAsync(string datasetId, string tableId, GetTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetTableAsync(TableReference, GetTableOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the requested table.

Example

See GetTable for a synchronous example.

GetTableAsync(String, String, String, GetTableOptions, CancellationToken)

public virtual Task<BigQueryTable> GetTableAsync(string projectId, string datasetId, string tableId, GetTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously retrieves the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to GetTableAsync(TableReference, GetTableOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

optionsGetTableOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryTable>

A task representing the asynchronous operation. When complete, the result is the requested table.

Example

See GetTable for a synchronous example.

GetTableReference(String, String)

public TableReference GetTableReference(string datasetId, string tableId)

Creates a Google.Apis.Bigquery.v2.Data.TableReference from the given dataset ID and table ID, using this client's project ID.

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.TableReference

A Google.Apis.Bigquery.v2.Data.TableReference representing the requested table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableReference reference = client.GetTableReference("dataset", "table");
// ProjectId is defaulted from the client in this overload
Console.WriteLine(reference.ProjectId);

GetTableReference(String, String, String)

public TableReference GetTableReference(string projectId, string datasetId, string tableId)

Creates a Google.Apis.Bigquery.v2.Data.TableReference from the given project ID, dataset ID and table ID.

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.TableReference

A Google.Apis.Bigquery.v2.Data.TableReference representing the requested table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
TableReference reference = client.GetTableReference("other-project", "dataset", "table");
// ProjectId is as specified in the call, not the client's project
Console.WriteLine(reference.ProjectId);

InsertRow(TableReference, BigQueryInsertRow, InsertOptions)

public virtual BigQueryInsertResults InsertRow(TableReference tableReference, BigQueryInsertRow row, InsertOptions options = null)

Inserts a single row of data into a table. This method just creates an array with the single element and delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See InsertRow for an example using an alternative overload.

InsertRow(String, String, BigQueryInsertRow, InsertOptions)

public virtual BigQueryInsertResults InsertRow(string datasetId, string tableId, BigQueryInsertRow row, InsertOptions options = null)

Inserts a single row of data into a table in this client's project specified by dataset ID and table ID. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRow(TableReference, BigQueryInsertRow, InsertOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
// The insert ID is optional; it is autogenerated if not specified.
BigQueryInsertRow row = new BigQueryInsertRow("row-single")
{
    { "player", "Jane" },
    { "level", 3 },
    { "score", 3600 },
    { "game_started", DateTime.UtcNow }
};
client.InsertRow(datasetId, tableId, row);

InsertRow(String, String, String, BigQueryInsertRow, InsertOptions)

public virtual BigQueryInsertResults InsertRow(string projectId, string datasetId, string tableId, BigQueryInsertRow row, InsertOptions options = null)

Inserts a single row of data into a table specified by project ID, dataset ID and table ID. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRow(TableReference, BigQueryInsertRow, InsertOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See InsertRow for an example using an alternative overload.

InsertRowAsync(TableReference, BigQueryInsertRow, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowAsync(TableReference tableReference, BigQueryInsertRow row, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts a single row of data into a table. This method just creates an array with the single element and delegates to InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRow for a synchronous example.

InsertRowAsync(String, String, BigQueryInsertRow, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowAsync(string datasetId, string tableId, BigQueryInsertRow row, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts a single row of data into a table in this client's project specified by dataset ID and table ID. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowAsync(TableReference, BigQueryInsertRow, InsertOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRow for a synchronous example.

InsertRowAsync(String, String, String, BigQueryInsertRow, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowAsync(string projectId, string datasetId, string tableId, BigQueryInsertRow row, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts a single row of data into a table specified by project ID, dataset ID and table ID. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowAsync(TableReference, BigQueryInsertRow, InsertOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowBigQueryInsertRow

The data to insert. Must not be null.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRow for a synchronous example.

InsertRows(TableReference, BigQueryInsertRow[])

public virtual BigQueryInsertResults InsertRows(TableReference tableReference, params BigQueryInsertRow[] rows)

Inserts all the specified rows into a table. This method just delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Remarks

Options are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Example

See InsertRows for an example using an alternative overload.

InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions)

public virtual BigQueryInsertResults InsertRows(TableReference tableReference, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null)

Inserts all the given rows of data into the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See InsertRows for an example using an alternative overload.

InsertRows(String, String, BigQueryInsertRow[])

public virtual BigQueryInsertResults InsertRows(string datasetId, string tableId, params BigQueryInsertRow[] rows)

Inserts all the specified rows into a table in this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, BigQueryInsertRow[]).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Remarks

Options are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRows(String, String, IEnumerable<BigQueryInsertRow>, InsertOptions).

Example
BigQueryClient client = BigQueryClient.Create(projectId);
// The insert ID is optional; it is autogenerated if not specified.
BigQueryInsertRow row1 = new BigQueryInsertRow("row1")
{
    { "player", "Jane" },
    { "level", 3 },
    { "score", 3600 },
    { "game_started", DateTime.UtcNow }
};
BigQueryInsertRow row2 = new BigQueryInsertRow("row2")
{
    { "player", "Jeff" },
    { "level", 2 },
    { "score", 2000 },
    { "game_started", DateTime.UtcNow }
};
client.InsertRows(datasetId, tableId, row1, row2);

InsertRows(String, String, IEnumerable<BigQueryInsertRow>, InsertOptions)

public virtual BigQueryInsertResults InsertRows(string datasetId, string tableId, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null)

Inserts all the given rows of data into the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See InsertRows for an example using an alternative overload.

InsertRows(String, String, String, BigQueryInsertRow[])

public virtual BigQueryInsertResults InsertRows(string projectId, string datasetId, string tableId, params BigQueryInsertRow[] rows)

Inserts all the specified rows into a table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, BigQueryInsertRow[]).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Remarks

Options are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRows(String, String, String, IEnumerable<BigQueryInsertRow>, InsertOptions).

Example

See InsertRows for an example using an alternative overload.

InsertRows(String, String, String, IEnumerable<BigQueryInsertRow>, InsertOptions)

public virtual BigQueryInsertResults InsertRows(string projectId, string datasetId, string tableId, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null)

Inserts all the given rows of data into the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See InsertRows for an example using an alternative overload.

InsertRowsAsync(TableReference, BigQueryInsertRow[])

public virtual Task<BigQueryInsertResults> InsertRowsAsync(TableReference tableReference, params BigQueryInsertRow[] rows)

Asynchronously inserts all the specified rows into a table. This method just delegates to InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Remarks

Options and cancellation tokens are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Example

See InsertRowsAsync for an example using an alternative overload.

InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowsAsync(TableReference tableReference, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts all the given rows of data into the specified table.

Parameters
NameDescription
tableReferenceGoogle.Apis.Bigquery.v2.Data.TableReference

A fully-qualified identifier for the table. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRowsAsync for an example using an alternative overload.

InsertRowsAsync(String, String, BigQueryInsertRow[])

public virtual Task<BigQueryInsertResults> InsertRowsAsync(string datasetId, string tableId, params BigQueryInsertRow[] rows)

Asynchronously inserts all the specified rows into a table in this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowsAsync(TableReference, BigQueryInsertRow[]).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Remarks

Options and cancellation tokens are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRowsAsync(String, String, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
// The insert ID is optional; it is autogenerated if not specified.
BigQueryInsertRow row1 = new BigQueryInsertRow("row1-async")
{
    { "player", "Jane" },
    { "level", 3 },
    { "score", 3600 },
    { "game_started", DateTime.UtcNow }
};
BigQueryInsertRow row2 = new BigQueryInsertRow("row2-async")
{
    { "player", "Jeff" },
    { "level", 2 },
    { "score", 2000 },
    { "game_started", DateTime.UtcNow }
};
await client.InsertRowsAsync(datasetId, tableId, row1, row2);

InsertRowsAsync(String, String, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowsAsync(string datasetId, string tableId, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts all the given rows of data into the specified table within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Parameters
NameDescription
datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRowsAsync for an example using an alternative overload.

InsertRowsAsync(String, String, String, BigQueryInsertRow[])

public virtual Task<BigQueryInsertResults> InsertRowsAsync(string projectId, string datasetId, string tableId, params BigQueryInsertRow[] rows)

Inserts all the specified rows into a table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowsAsync(TableReference, BigQueryInsertRow[]).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsBigQueryInsertRow[]

The rows to insert. Must not be null, or contain null elements.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Remarks

Options and cancellation tokens are not supported on this call due to restrictions with methods containing a parameter array and optional parameters. To specify options, create a collection or array explicitly, and call InsertRowsAsync(String, String, String, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Example

See InsertRowsAsync for an example using an alternative overload.

InsertRowsAsync(String, String, String, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken)

public virtual Task<BigQueryInsertResults> InsertRowsAsync(string projectId, string datasetId, string tableId, IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Asynchronously inserts all the given rows of data into the specified table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Parameters
NameDescription
projectIdString

The project ID. Must not be null.

datasetIdString

The dataset ID. Must not be null.

tableIdString

The table ID. Must not be null.

rowsIEnumerable<BigQueryInsertRow>

The data to insert. Must not be null, or contain null entries.

optionsInsertOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task<BigQueryInsertResults>

A task representing the asynchronous operation. When complete, the result is an insert result object which contains information on insert errors if any.

Example

See InsertRowsAsync for an example using an alternative overload.

ListDatasets(ProjectReference, ListDatasetsOptions)

public virtual PagedEnumerable<DatasetList, BigQueryDataset> ListDatasets(ProjectReference projectReference, ListDatasetsOptions options = null)

Lists the datasets within the specified project.

Parameters
NameDescription
projectReferenceGoogle.Apis.Bigquery.v2.Data.ProjectReference

A fully-qualified identifier for the project. Must not be null.

optionsListDatasetsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
PagedEnumerable<Google.Apis.Bigquery.v2.Data.DatasetList, BigQueryDataset>

A sequence of datasets within the specified project.

Remarks

No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.

Example

See ListDatasets for an example using an alternative overload.

ListDatasets(ListDatasetsOptions)

public virtual PagedEnumerable<DatasetList, BigQueryDataset> ListDatasets(ListDatasetsOptions options = null)

Lists the datasets within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to ListDatasets(ProjectReference, ListDatasetsOptions).

Parameter
NameDescription
optionsListDatasetsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
PagedEnumerable<Google.Apis.Bigquery.v2.Data.DatasetList, BigQueryDataset>

A sequence of datasets within this project.

Remarks

No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
List<BigQueryDataset> datasets = client.ListDatasets().Take(20).ToList();
foreach (BigQueryDataset dataset in datasets)
{
    Console.WriteLine(dataset.FullyQualifiedId);
}

ListDatasets(String, ListDatasetsOptions)

public virtual PagedEnumerable<DatasetList, BigQueryDataset> ListDatasets(string projectId, ListDatasetsOptions options = null)

Lists the datasets within the specified project. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to ListDatasets(ProjectReference, ListDatasetsOptions).

Parameters
NameDescription
projectIdString

The project to list the datasets from. Must not be null.

optionsListDatasetsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
PagedEnumerable<Google.Apis.Bigquery.v2.Data.DatasetList, BigQueryDataset>

A sequence of datasets within the specified project.

Remarks

No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.

Example

See ListDatasets for an example using an alternative overload.

ListDatasetsAsync(ProjectReference, ListDatasetsOptions)

public virtual PagedAsyncEnumerable<DatasetList, BigQueryDataset> ListDatasetsAsync(ProjectReference projectReference, ListDatasetsOptions options = null)

Asynchronously lists the datasets within the specified project.

Parameters
NameDescription
projectReferenceGoogle.Apis.Bigquery.v2.Data.ProjectReference

A fully-qualified identifier for the project. Must not be null.

optionsListDatasetsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
PagedAsyncEnumerable<Google.Apis.Bigquery.v2.Data.DatasetList, BigQueryDataset>

An asynchronous sequence of datasets within the specified project.

Remarks

No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.

Example

See ListDatasetsAsync for an example using an alternative overload.

ListDatasetsAsync(ListDatasetsOptions)

public virtual PagedAsyncEnumerable<DatasetList, BigQueryDataset> ListDatasetsAsync(ListDatasetsOptions options = null)

Asynchronously lists the datasets within this client's project. This method just creates a Google.Apis.Bigquery.v2.Data.ProjectReference and delegates to ListDatasetsAsync(ProjectReference, ListDatasetsOptions).

Parameter
NameDescription
optionsListDatasetsOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
PagedAsyncEnumerable<Google.Apis.Bigquery.v2.Data.DatasetList, BigQueryDataset>

An asynchronous sequence of datasets within this project.

Remarks

No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.

Example
BigQueryClient client = await BigQueryClient.CreateAsync(projectId);
List<BigQueryDataset> datasets = await client.ListDatasetsAsync().Take(20).ToListAsync();
foreach (BigQueryDataset dataset in datasets)
{
    Console.WriteLine(dataset.FullyQualifiedId);
}

ListDatasetsAsync(String, ListDatasetsOptions)

public virtual PagedAsyncEnumerable<DatasetList, BigQueryDataset> ListDatasetsAsync(string projectId, ListDatasetsOptions options = null)