Class BigQueryTable (2.2.0)

public sealed class BigQueryTable : IFormattable

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.

resourceGoogle.Apis.Bigquery.v2.Data.Table

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
Google.Apis.Bigquery.v2.Data.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
Google.Apis.Bigquery.v2.Data.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
Google.Apis.Bigquery.v2.Data.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 Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateCopyJob(TableReference, TableReference, CreateCopyJobOptions).

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

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(CancellationToken))

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

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

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
Task<BigQueryJob>

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 Google.Apis.Bigquery.v2.Data.TableReference and delegates to CreateExtractJob(TableReference, IEnumerable<String>, CreateExtractJobOptions). See the BigQuery documentation for more information on extract jobs.

Parameters
NameDescription
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 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 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
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(CancellationToken))

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

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

CreateExtractJobAsync(String, CreateExtractJobOptions, CancellationToken)

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

Asynchronously creates a job to extract data from this 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
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 BigQueryClient.CreateExtractJobAsync for an example using BigQueryClient.

Delete(DeleteTableOptions)

public void Delete(DeleteTableOptions options = null)

Deletes this table. This method just creates a Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously deletes this table. This method just creates a Google.Apis.Bigquery.v2.Data.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.

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously inserts a single row of data into this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
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 BigQueryClient.InsertRow for an example using BigQueryClient.

InsertRows(BigQueryInsertRow[])

public BigQueryInsertResults InsertRows(params BigQueryInsertRow[] rows)

Inserts all the given rows of data into this table. This method just creates a Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, 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 Google.Apis.Bigquery.v2.Data.TableReference and delegates to InsertRows(TableReference, IEnumerable<BigQueryInsertRow>, InsertOptions).

Parameters
NameDescription
rowsIEnumerable<BigQueryInsertRow>

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(BigQueryInsertRow[])

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

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

Parameter
NameDescription
rowsBigQueryInsertRow[]

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

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 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(CancellationToken))

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

Parameters
NameDescription
rowsIEnumerable<BigQueryInsertRow>

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
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 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 Google.Apis.Bigquery.v2.Data.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
PagedEnumerable<Google.Apis.Bigquery.v2.Data.TableDataList, BigQueryRow>

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 Google.Apis.Bigquery.v2.Data.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
PagedAsyncEnumerable<Google.Apis.Bigquery.v2.Data.TableDataList, BigQueryRow>

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, Boolean, PatchTableOptions)

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

Patches this table with fields in the specified resource.

Parameters
NameDescription
resourceGoogle.Apis.Bigquery.v2.Data.Table

The resource to patch with. Must not be null.

matchETagBoolean

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, Boolean, PatchTableOptions, CancellationToken)

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

Asynchronously patches this table with fields in the specified resource.

Parameters
NameDescription
resourceGoogle.Apis.Bigquery.v2.Data.Table

The resource to patch with. Must not be null.

matchETagBoolean

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
Task<BigQueryTable>

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

Remarks Example

See Patch for a synchronous example.

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
resourceGoogle.Apis.Bigquery.v2.Data.Table

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(CancellationToken))

Asynchronously updates this table to match the specified resource.

Parameters
NameDescription
resourceGoogle.Apis.Bigquery.v2.Data.Table

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
Task<BigQueryTable>

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously uploads a stream of Avro data to this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
Task<BigQueryJob>

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously uploads a stream of CSV data to this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
Task<BigQueryJob>

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 Google.Apis.Bigquery.v2.Data.TableReference and delegates to UploadJson(TableReference, TableSchema, IEnumerable<String>, UploadJsonOptions).

Parameters
NameDescription
rowsIEnumerable<String>

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

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

Parameters
NameDescription
rowsIEnumerable<String>

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
Task<BigQueryJob>

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(CancellationToken))

Asynchronously uploads a sequence of JSON rows to this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
Task<BigQueryJob>

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously uploads a stream of ORC data to this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
Task<BigQueryJob>

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 Google.Apis.Bigquery.v2.Data.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(CancellationToken))

Asynchronously uploads a stream of Parquet data to this table. This method just creates a Google.Apis.Bigquery.v2.Data.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
Task<BigQueryJob>

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

Example

See BigQueryClient.UploadParquet for an example using BigQueryClient.