Google BigQuery v2 API - Class BigQueryTable (3.9.0)

public sealed class BigQueryTable : IFormattable

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

A table within a BigQuery dataset.

Inheritance

object > BigQueryTable

Implements

IFormattable

Namespace

Google.Cloud.BigQuery.V2

Assembly

Google.Cloud.BigQuery.V2.dll

Remarks

This class wraps the underlying REST API resource and retains a reference to the original client, allowing for simpler table-oriented operations.

Constructors

BigQueryTable(BigQueryClient, Table)

public BigQueryTable(BigQueryClient client, Table resource)

Constructs a new table.

Parameters
NameDescription
clientBigQueryClient

The client to use for operations on the table. Must not be null.

resourceTable

The REST-ful resource representing the table. Must not be null.

Remarks

This is public to allow tests to construct instances for production code to consume; production code should not normally construct instances itself.

Properties

FullyQualifiedId

public string FullyQualifiedId { get; }

The fully-qualified identifier for the table in a string form of project.dataset.table.

Property Value
TypeDescription
string

Reference

public TableReference Reference { get; }

The fully-qualified identifier for the table, as an object which can be used for other operations within this API.

Property Value
TypeDescription
TableReference
Remarks

The properties within the reference can be used to determine the project ID, dataset ID and table ID components.

Resource

public Table Resource { get; }

The underlying REST-ful resource for the table.

Property Value
TypeDescription
Table
Remarks

The data within the resource may be incomplete, depending on how it was obtained. (ListTables operations return less data than GetTable operations.)

Schema

public TableSchema Schema { get; }

The schema of this table, if known. Schemas are not retrieved when listing the tables within a dataset, so the value of this property can be null.

Property Value
TypeDescription
TableSchema

Methods

CreateCopyJob(TableReference, CreateCopyJobOptions)

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

Creates a job to copy data from this table to another. This method just creates a TableReference and delegates to CreateCopyJob(TableReference, TableReference, CreateCopyJobOptions).

Parameters
NameDescription
destinationTableReference

The destination table 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

This method only allows one table (this one) to be used as the source table. To copy multiple tables to one destination table, use CreateCopyJob(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions).

Example

See BigQueryClient.CreateCopyJob for an example using BigQueryClient.

CreateCopyJobAsync(TableReference, CreateCopyJobOptions, CancellationToken)

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

Asynchronously creates a job to copy data from this table to another. This method just creates a TableReference and delegates to CreateCopyJobAsync(TableReference, TableReference, CreateCopyJobOptions, CancellationToken).

Parameters
NameDescription
destinationTableReference

The destination table 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
TaskBigQueryJob

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

Remarks

This method only allows one table (this one) to be used as the source table. To copy multiple tables to one destination table, use CreateCopyJobAsync(IEnumerable<TableReference>, TableReference, CreateCopyJobOptions, CancellationToken).

Example

See BigQueryClient.CreateCopyJobAsync for an example using BigQueryClient.

CreateExtractJob(IEnumerable<string>, CreateExtractJobOptions)

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

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

Parameters
NameDescription
destinationUrisIEnumerablestring

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 BigQueryClient.CreateExtractJob for an example using BigQueryClient.

CreateExtractJob(string, CreateExtractJobOptions)

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

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

Parameters
NameDescription
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 BigQueryClient.CreateExtractJob for an example using BigQueryClient.

CreateExtractJobAsync(IEnumerable<string>, CreateExtractJobOptions, CancellationToken)

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

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

Parameters
NameDescription
destinationUrisIEnumerablestring

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
TaskBigQueryJob

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

Example

See BigQueryClient.CreateExtractJobAsync for an example using BigQueryClient.

CreateExtractJobAsync(string, CreateExtractJobOptions, CancellationToken)

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

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

Parameters
NameDescription
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
TaskBigQueryJob

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

Example

See BigQueryClient.CreateExtractJobAsync for an example using BigQueryClient.

Delete(DeleteTableOptions)

public void Delete(DeleteTableOptions options = null)

Deletes this table. This method just creates a TableReference and delegates to DeleteTable(TableReference, DeleteTableOptions).

Parameter
NameDescription
optionsDeleteTableOptions

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

Example

See BigQueryClient.DeleteTable for an example using BigQueryClient.

DeleteAsync(DeleteTableOptions, CancellationToken)

public Task DeleteAsync(DeleteTableOptions options = null, CancellationToken cancellationToken = default)

Asynchronously deletes this table. This method just creates a TableReference and delegates to DeleteTableAsync(TableReference, DeleteTableOptions, CancellationToken).

Parameters
NameDescription
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 BigQueryClient.DeleteTableAsync for an example using BigQueryClient.

GetIamPolicy(GetTableIamPolicyOptions)

public Policy GetIamPolicy(GetTableIamPolicyOptions options = null)

Gets the IAM policy applied to this table.

Parameter
NameDescription
optionsGetTableIamPolicyOptions

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

Returns
TypeDescription
Policy

The IAM policy.

Remarks

GetIamPolicyAsync(GetTableIamPolicyOptions, CancellationToken)

public Task<Policy> GetIamPolicyAsync(GetTableIamPolicyOptions options = null, CancellationToken cancellationToken = default)

Asynchronously gets the IAM policy applied to this table.

Parameters
NameDescription
optionsGetTableIamPolicyOptions

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
TaskPolicy

A task representing the asynchronous operation. When complete, the result is the IAM policy obtained.

Remarks

InsertRow(BigQueryInsertRow, InsertOptions)

public BigQueryInsertResults InsertRow(BigQueryInsertRow row, InsertOptions options = null)

Inserts a single row of data into this table. This method just creates a TableReference and delegates to InsertRow(TableReference, BigQueryInsertRow, InsertOptions).

Parameters
NameDescription
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 BigQueryClient.InsertRow for an example using BigQueryClient.

InsertRowAsync(BigQueryInsertRow, InsertOptions, CancellationToken)

public Task<BigQueryInsertResults> InsertRowAsync(BigQueryInsertRow row, InsertOptions options = null, CancellationToken cancellationToken = default)

Asynchronously inserts a single row of data into this table. This method just creates a TableReference and delegates to InsertRowAsync(TableReference, BigQueryInsertRow, InsertOptions, CancellationToken).

Parameters
NameDescription
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
TaskBigQueryInsertResults

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 BigQueryClient.InsertRow for an example using BigQueryClient.

InsertRows(params BigQueryInsertRow[])

public BigQueryInsertResults InsertRows(params BigQueryInsertRow[] rows)

Inserts all the given rows of data into this table. This method just creates a TableReference and delegates to InsertRows(TableReference, params BigQueryInsertRow[]).

Parameter
NameDescription
rowsBigQueryInsertRow

The rows to insert. Must not be null or contain null entries.

Returns
TypeDescription
BigQueryInsertResults

An insert result object which contains information on insert errors if any.

Example

See BigQueryClient.InsertRows for an example using BigQueryClient.

InsertRows(IEnumerable<BigQueryInsertRow>, InsertOptions)

public BigQueryInsertResults InsertRows(IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null)

Inserts all the given rows of data into this table. This method just creates a TableReference and delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
rowsIEnumerableBigQueryInsertRow

The rows 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 BigQueryClient.InsertRows for an example using BigQueryClient.

InsertRowsAsync(params BigQueryInsertRow[])

public Task<BigQueryInsertResults> InsertRowsAsync(params BigQueryInsertRow[] rows)

Asynchronously inserts all the given rows of data into this table. This method just creates a TableReference and delegates to InsertRowsAsync(TableReference, params BigQueryInsertRow[]).

Parameter
NameDescription
rowsBigQueryInsertRow

The rows to insert. Must not be null or contain null entries.

Returns
TypeDescription
TaskBigQueryInsertResults

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 BigQueryClient.InsertRowAsync for an example using BigQueryClient.

InsertRowsAsync(IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken)

public Task<BigQueryInsertResults> InsertRowsAsync(IEnumerable<BigQueryInsertRow> rows, InsertOptions options = null, CancellationToken cancellationToken = default)

Asynchronously inserts all the given rows of data into this table. This method just creates a TableReference and delegates to InsertRowsAsync(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions, CancellationToken).

Parameters
NameDescription
rowsIEnumerableBigQueryInsertRow

The rows 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
TaskBigQueryInsertResults

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 BigQueryClient.InsertRowAsync for an example using BigQueryClient.

ListRows(ListRowsOptions)

public PagedEnumerable<TableDataList, BigQueryRow> ListRows(ListRowsOptions options = null)

Lists the rows within this table, similar to a SELECT * FROM ... query. This method just creates a TableReference and delegates to ListRows(TableReference, TableSchema, ListRowsOptions).

Parameter
NameDescription
optionsListRowsOptions

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

Returns
TypeDescription
PagedEnumerableTableDataListBigQueryRow

The results of listing the rows within the table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, tableId);
PagedEnumerable<TableDataList, BigQueryRow> result = table.ListRows();
foreach (BigQueryRow row in result)
{
    DateTime timestamp = (DateTime)row["game_started"];
    long level = (long)row["level"];
    long score = (long)row["score"];
    string player = (string)row["player"];
    Console.WriteLine($"{player}: {level}/{score} ({timestamp:yyyy-MM-dd HH:mm:ss})");
}

ListRowsAsync(ListRowsOptions)

public PagedAsyncEnumerable<TableDataList, BigQueryRow> ListRowsAsync(ListRowsOptions options = null)

Asynchronously lists the rows within this table, similar to a SELECT * FROM ... query. This method just creates a TableReference and delegates to ListRowsAsync(TableReference, TableSchema, ListRowsOptions).

Parameter
NameDescription
optionsListRowsOptions

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

Returns
TypeDescription
PagedAsyncEnumerableTableDataListBigQueryRow

An asynchronous sequence of the rows within the table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, tableId);
PagedAsyncEnumerable<TableDataList, BigQueryRow> result = table.ListRowsAsync();
await result.ForEachAsync(row =>
{
    DateTime timestamp = (DateTime)row["game_started"];
    long level = (long)row["level"];
    long score = (long)row["score"];
    string player = (string)row["player"];
    Console.WriteLine($"{player}: {level}/{score} ({timestamp:yyyy-MM-dd HH:mm:ss})");
});

Patch(Table, bool, PatchTableOptions)

public BigQueryTable Patch(Table resource, bool matchETag, PatchTableOptions options = null)

Patches this table with fields in the specified resource.

Parameters
NameDescription
resourceTable

The resource to patch with. Must not be null.

matchETagbool

If true, the etag from Resource is propagated into resource for optimistic concurrency. Otherwise, resource is left unchanged.

optionsPatchTableOptions

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

Returns
TypeDescription
BigQueryTable

The updated table.

Remarks Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable dataset = client.GetTable(datasetId, tableId);

// There's no ETag in this Table. The matchETag parameter in the method call
// determines whether the ETag in the original resource is propagated into the
// patch.
Table patch = new Table
{
    FriendlyName = "Patched table"
};
BigQueryTable updated = dataset.Patch(patch, matchETag: true);

Console.WriteLine($"Patched table friendly name: {updated.Resource.FriendlyName}");

PatchAsync(Table, bool, PatchTableOptions, CancellationToken)

public Task<BigQueryTable> PatchAsync(Table resource, bool matchETag, PatchTableOptions options = null, CancellationToken cancellationToken = default)

Asynchronously patches this table with fields in the specified resource.

Parameters
NameDescription
resourceTable

The resource to patch with. Must not be null.

matchETagbool

If true, the etag from Resource is propagated into resource for optimistic concurrency. Otherwise, resource is left unchanged.

optionsPatchTableOptions

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
TaskBigQueryTable

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

Remarks Example

See Patch for a synchronous example.

SetIamPolicy(Policy, SetTableIamPolicyOptions)

public Policy SetIamPolicy(Policy policy, SetTableIamPolicyOptions options = null)

Applies the given IAM policy to this table. An update mask may be provided through options.

Parameters
NameDescription
policyPolicy

The policy to apply to this table.

optionsSetTableIamPolicyOptions

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

Returns
TypeDescription
Policy

The resulting IAM policy after appying policy to this table.

Remarks

SetIamPolicyAsync(Policy, SetTableIamPolicyOptions, CancellationToken)

public Task<Policy> SetIamPolicyAsync(Policy policy, SetTableIamPolicyOptions options = null, CancellationToken cancellationToken = default)

Asynchronously applies the given IAM policy to this table. An update mask may be provided through options.

Parameters
NameDescription
policyPolicy

The policy to apply to this table.

optionsSetTableIamPolicyOptions

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
TaskPolicy

A task representing the asynchronous operation. When complete, the result is the resulting IAM policy after appying policy to this table.

Remarks

TestIamPermissions(IList<string>, TestTableIamPermissionsOptions)

public TestIamPermissionsResponse TestIamPermissions(IList<string> permissions, TestTableIamPermissionsOptions options = null)

Tests whether the caller has the given permissions for this table.

Parameters
NameDescription
permissionsIListstring

The table permissions to test for this caller.

optionsTestTableIamPermissionsOptions

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

Returns
TypeDescription
TestIamPermissionsResponse

A response object that contains a list of permissions which is the subset of permissions that the caller has on this table.

Remarks

TestIamPermissionsAsync(IList<string>, TestTableIamPermissionsOptions, CancellationToken)

public Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IList<string> permissions, TestTableIamPermissionsOptions options = null, CancellationToken cancellationToken = default)

Asynchronously tests whether the caller has the given permissions for this table.

Parameters
NameDescription
permissionsIListstring

The table permissions to test for this caller.

optionsTestTableIamPermissionsOptions

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
TaskTestIamPermissionsResponse

A task representing the asynchronous operation. When complete, the result is a response object that contains a list of permissions which is the subset of permissions that the caller has on this table.

Remarks

ToLegacySqlFormat()

public string ToLegacySqlFormat()

Returns the fully-qualified ID of the table in Legacy SQL format. The Legacy SQL format uses square brackets instead of backticks to surround the ID, and uses a colon instead of a period between the project ID and the dataset ID.

Returns
TypeDescription
string

The fully-qualified ID of the table in Legacy SQL format.

ToString()

public override string ToString()

Returns the fully-qualified ID of the table in backticks.

Returns
TypeDescription
string
Overrides Remarks

This is designed to facilitate constructing queries by simply including the table in the string.

ToString(string, IFormatProvider)

public string ToString(string format, IFormatProvider formatProvider)

Returns the fully-qualified ID of the table, in either the Standard SQL or Legacy SQL format.

Parameters
NameDescription
formatstring

If this has a value of "legacy", the Legacy SQL format is used; otherwise, the Standard SQL format is used.

formatProviderIFormatProvider

Ignored.

Returns
TypeDescription
string

The formatted table name.

Remarks

This method allows the Legacy SQL format to be used simply within an interpolated string.

Update(Table, UpdateTableOptions)

public BigQueryTable Update(Table resource = null, UpdateTableOptions options = null)

Updates this table to match the specified resource.

Parameters
NameDescription
resourceTable

The resource to update with. If null, the Resource property is used.

optionsUpdateTableOptions

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

Returns
TypeDescription
BigQueryTable

The updated table.

Remarks

This method delegates to UpdateTable(TableReference, Table, UpdateTableOptions). A simple way of updating the table is to modify Resource and then call this method with no arguments. This is convenient, but it's important to understand that modifying Resource in this way leaves this object in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag will be the original etag, rather than the one associated with the updated table. To avoid this causing confusion, we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method as the new, self-consistent representation of the table.

Example
BigQueryClient client = BigQueryClient.Create(projectId);
BigQueryTable table = client.GetTable(datasetId, tableId);

// This example modifies the in-memory resource in the BigQueryDataset,
// and then applies that change in the server. Alternatively, pass a Dataset
// into the Update method.
table.Resource.FriendlyName = "Updated table";
BigQueryTable updated = table.Update();

Console.WriteLine($"Updated table friendly name: {updated.Resource.FriendlyName}");

UpdateAsync(Table, UpdateTableOptions, CancellationToken)

public Task<BigQueryTable> UpdateAsync(Table resource = null, UpdateTableOptions options = null, CancellationToken cancellationToken = default)

Asynchronously updates this table to match the specified resource.

Parameters
NameDescription
resourceTable

The resource to update with. If null, the Resource property is used.

optionsUpdateTableOptions

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
TaskBigQueryTable

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

Remarks

This method delegates to UpdateTableAsync(TableReference, Table, UpdateTableOptions, CancellationToken). A simple way of updating the table is to modify Resource and then call this method with no arguments. This is convenient, but it's important to understand that modifying Resource in this way leaves this object in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag will be the original etag, rather than the one associated with the updated table. To avoid this causing confusion, we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method as the new, self-consistent representation of the table.

Example

See Update for a synchronous example.

UploadAvro(Stream, UploadAvroOptions)

public BigQueryJob UploadAvro(Stream input, UploadAvroOptions options = null)

Uploads a stream of Avro data to this table. This method just creates a TableReference and delegates to UploadAvro(TableReference, TableSchema, Stream, UploadAvroOptions).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadAvroOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Example

See BigQueryClient.UploadAvro for an example using BigQueryClient.

UploadAvroAsync(Stream, UploadAvroOptions, CancellationToken)

public Task<BigQueryJob> UploadAvroAsync(Stream input, UploadAvroOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a stream of Avro data to this table. This method just creates a TableReference and delegates to UploadAvroAsync(TableReference, TableSchema, Stream, UploadAvroOptions, CancellationToken).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadAvroOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Example

See BigQueryClient.UploadAvro for an example using BigQueryClient.

UploadCsv(Stream, UploadCsvOptions)

public BigQueryJob UploadCsv(Stream input, UploadCsvOptions options = null)

Uploads a stream of CSV data to this table. This method just creates a TableReference and delegates to UploadCsv(TableReference, TableSchema, Stream, UploadCsvOptions).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadCsvOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Example

See BigQueryClient.UploadCsv for an example using BigQueryClient.

UploadCsvAsync(Stream, UploadCsvOptions, CancellationToken)

public Task<BigQueryJob> UploadCsvAsync(Stream input, UploadCsvOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a stream of CSV data to this table. This method just creates a TableReference and delegates to UploadCsvAsync(TableReference, TableSchema, Stream, UploadCsvOptions, CancellationToken).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadCsvOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Example

See BigQueryClient.UploadCsvAsync for an example using BigQueryClient.

UploadJson(IEnumerable<string>, UploadJsonOptions)

public BigQueryJob UploadJson(IEnumerable<string> rows, UploadJsonOptions options = null)

Uploads a sequence of JSON rows to this table. This method just creates a TableReference and delegates to UploadJson(TableReference, TableSchema, IEnumerable<string>, UploadJsonOptions).

Parameters
NameDescription
rowsIEnumerablestring

The sequence of JSON strings to upload. Must not be null, and must not contain null elements.

optionsUploadJsonOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Remarks

Each element of rows is converted into a single line of text by replacing carriage returns and line feeds with spaces. This is safe as they cannot exist within well-formed JSON keys or values, and simply means that the original JSON can be formatted however you choose.

Example

See BigQueryClient.UploadJson for an example using BigQueryClient.

UploadJson(Stream, UploadJsonOptions)

public BigQueryJob UploadJson(Stream input, UploadJsonOptions options = null)

Uploads a stream of JSON data to this table. This method just creates a TableReference and delegates to UploadJson(TableReference, TableSchema, Stream, UploadJsonOptions).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadJsonOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Example

See BigQueryClient.UploadJson for an example using BigQueryClient.

UploadJsonAsync(IEnumerable<string>, UploadJsonOptions, CancellationToken)

public Task<BigQueryJob> UploadJsonAsync(IEnumerable<string> rows, UploadJsonOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a stream of JSON data to this table. This method just creates a TableReference and delegates to UploadJsonAsync(TableReference, TableSchema, IEnumerable<string>, UploadJsonOptions, CancellationToken).

Parameters
NameDescription
rowsIEnumerablestring

The sequence of JSON strings to upload. Must not be null, and must not contain null elements.

optionsUploadJsonOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Remarks

Each element of rows is converted into a single line of text by replacing carriage returns and line feeds with spaces. This is safe as they cannot exist within well-formed JSON keys or values, and simply means that the original JSON can be formatted however you choose.

Example

See BigQueryClient.UploadJsonAsync for an example using BigQueryClient.

UploadJsonAsync(Stream, UploadJsonOptions, CancellationToken)

public Task<BigQueryJob> UploadJsonAsync(Stream input, UploadJsonOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a sequence of JSON rows to this table. This method just creates a TableReference and delegates to UploadJsonAsync(TableReference, TableSchema, Stream, UploadJsonOptions, CancellationToken).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadJsonOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Example

See BigQueryClient.UploadJsonAsync for an example using BigQueryClient.

UploadOrc(Stream, UploadOrcOptions)

public BigQueryJob UploadOrc(Stream input, UploadOrcOptions options = null)

Uploads a stream of ORC data to this table. This method just creates a TableReference and delegates to UploadOrc(TableReference, Stream, UploadOrcOptions).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadOrcOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Example

See BigQueryClient.UploadOrc for an example using BigQueryClient.

UploadOrcAsync(Stream, UploadOrcOptions, CancellationToken)

public Task<BigQueryJob> UploadOrcAsync(Stream input, UploadOrcOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a stream of ORC data to this table. This method just creates a TableReference and delegates to UploadOrcAsync(TableReference, Stream, UploadOrcOptions, CancellationToken).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadOrcOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Example

See BigQueryClient.UploadOrc for an example using BigQueryClient.

UploadParquet(Stream, UploadParquetOptions)

public BigQueryJob UploadParquet(Stream input, UploadParquetOptions options = null)

Uploads a stream of Parquet data to this table. This method just creates a TableReference and delegates to UploadParquet(TableReference, Stream, UploadParquetOptions).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadParquetOptions

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

Returns
TypeDescription
BigQueryJob

A data upload job.

Example

See BigQueryClient.UploadParquet for an example using BigQueryClient.

UploadParquetAsync(Stream, UploadParquetOptions, CancellationToken)

public Task<BigQueryJob> UploadParquetAsync(Stream input, UploadParquetOptions options = null, CancellationToken cancellationToken = default)

Asynchronously uploads a stream of Parquet data to this table. This method just creates a TableReference and delegates to UploadParquetAsync(TableReference, Stream, UploadParquetOptions, CancellationToken).

Parameters
NameDescription
inputStream

The stream of input data. Must not be null.

optionsUploadParquetOptions

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
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is a data upload job.

Example

See BigQueryClient.UploadParquet for an example using BigQueryClient.