Class BigQueryReadClient (2.7.0)

public abstract class BigQueryReadClient

BigQueryRead client wrapper, for convenient use.

Inheritance

Object > BigQueryReadClient

Derived Types

Namespace

Google.Cloud.BigQuery.Storage.V1

Assembly

Google.Cloud.BigQuery.Storage.V1.dll

Remarks

BigQuery Read API.

The Read API can be used to read data from BigQuery.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the BigQueryRead service, which is a host of "bigquerystorage.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default BigQueryRead scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual BigQueryRead.BigQueryReadClient GrpcClient { get; }

The underlying gRPC BigQueryRead client

Property Value
TypeDescription
BigQueryRead.BigQueryReadClient

Methods

Create()

public static BigQueryReadClient Create()

Synchronously creates a BigQueryReadClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BigQueryReadClientBuilder.

Returns
TypeDescription
BigQueryReadClient

The created BigQueryReadClient.

CreateAsync(CancellationToken)

public static Task<BigQueryReadClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a BigQueryReadClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BigQueryReadClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<BigQueryReadClient>

The task representing the created BigQueryReadClient.

CreateReadSession(ProjectName, ReadSession, Int32, CallSettings)

public virtual ReadSession CreateReadSession(ProjectName parent, ReadSession readSession, int maxStreamCount, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentProjectName

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadSession

The RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = bigQueryReadClient.CreateReadSession(parent, readSession, maxStreamCount);

CreateReadSession(CreateReadSessionRequest, CallSettings)

public virtual ReadSession CreateReadSession(CreateReadSessionRequest request, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
requestCreateReadSessionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadSession

The RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    ReadSession = new ReadSession(),
    MaxStreamCount = 0,
};
// Make the request
ReadSession response = bigQueryReadClient.CreateReadSession(request);

CreateReadSession(String, ReadSession, Int32, CallSettings)

public virtual ReadSession CreateReadSession(string parent, ReadSession readSession, int maxStreamCount, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentString

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReadSession

The RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = bigQueryReadClient.CreateReadSession(parent, readSession, maxStreamCount);

CreateReadSessionAsync(ProjectName, ReadSession, Int32, CallSettings)

public virtual Task<ReadSession> CreateReadSessionAsync(ProjectName parent, ReadSession readSession, int maxStreamCount, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentProjectName

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(parent, readSession, maxStreamCount);

CreateReadSessionAsync(ProjectName, ReadSession, Int32, CancellationToken)

public virtual Task<ReadSession> CreateReadSessionAsync(ProjectName parent, ReadSession readSession, int maxStreamCount, CancellationToken cancellationToken)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentProjectName

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(parent, readSession, maxStreamCount);

CreateReadSessionAsync(CreateReadSessionRequest, CallSettings)

public virtual Task<ReadSession> CreateReadSessionAsync(CreateReadSessionRequest request, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
requestCreateReadSessionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    ReadSession = new ReadSession(),
    MaxStreamCount = 0,
};
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(request);

CreateReadSessionAsync(CreateReadSessionRequest, CancellationToken)

public virtual Task<ReadSession> CreateReadSessionAsync(CreateReadSessionRequest request, CancellationToken cancellationToken)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
requestCreateReadSessionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    ReadSession = new ReadSession(),
    MaxStreamCount = 0,
};
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(request);

CreateReadSessionAsync(String, ReadSession, Int32, CallSettings)

public virtual Task<ReadSession> CreateReadSessionAsync(string parent, ReadSession readSession, int maxStreamCount, CallSettings callSettings = null)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentString

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(parent, readSession, maxStreamCount);

CreateReadSessionAsync(String, ReadSession, Int32, CancellationToken)

public virtual Task<ReadSession> CreateReadSessionAsync(string parent, ReadSession readSession, int maxStreamCount, CancellationToken cancellationToken)

Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read.

Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments.

Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.

Parameters
NameDescription
parentString

Required. The request project that owns the session, in the form of projects/{project_id}.

readSessionReadSession

Required. Session to be created.

maxStreamCountInt32

Max initial number of streams. If unset or zero, the server will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table. Error will be returned if the max count is greater than the current system max limit of 1,000.

Streams must be read starting from offset 0.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReadSession>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
ReadSession readSession = new ReadSession();
int maxStreamCount = 0;
// Make the request
ReadSession response = await bigQueryReadClient.CreateReadSessionAsync(parent, readSession, maxStreamCount);

ReadRows(ReadRowsRequest, CallSettings)

public virtual BigQueryReadClient.ReadRowsStream ReadRows(ReadRowsRequest request, CallSettings callSettings = null)

Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail.

Each request also returns a set of stream statistics reflecting the current state of the stream.

Parameters
NameDescription
requestReadRowsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigQueryReadClient.ReadRowsStream

The server stream.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
ReadRowsRequest request = new ReadRowsRequest
{
    ReadStreamAsReadStreamName = ReadStreamName.FromProjectLocationSessionStream("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]"),
    Offset = 0L,
};
// Make the request, returning a streaming response
BigQueryReadClient.ReadRowsStream response = bigQueryReadClient.ReadRows(request);

// Read streaming responses from server until complete
// Note that C# 8 code can use await foreach
AsyncResponseStream<ReadRowsResponse> responseStream = response.GetResponseStream();
while (await responseStream.MoveNextAsync())
{
    ReadRowsResponse responseItem = responseStream.Current;
    // Do something with streamed response
}
// The response stream has completed

ReadRows(ReadStreamName, Int64, CallSettings)

public virtual BigQueryReadClient.ReadRowsStream ReadRows(ReadStreamName readStream, long offset, CallSettings callSettings = null)

Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail.

Each request also returns a set of stream statistics reflecting the current state of the stream.

Parameters
NameDescription
readStreamReadStreamName

Required. Stream to read rows from.

offsetInt64

The offset requested must be less than the last row read from Read. Requesting a larger offset is undefined. If not specified, start reading from offset zero.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigQueryReadClient.ReadRowsStream

The server stream.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
ReadStreamName readStream = ReadStreamName.FromProjectLocationSessionStream("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]");
long offset = 0L;
// Make the request, returning a streaming response
BigQueryReadClient.ReadRowsStream response = bigQueryReadClient.ReadRows(readStream, offset);

// Read streaming responses from server until complete
// Note that C# 8 code can use await foreach
AsyncResponseStream<ReadRowsResponse> responseStream = response.GetResponseStream();
while (await responseStream.MoveNextAsync())
{
    ReadRowsResponse responseItem = responseStream.Current;
    // Do something with streamed response
}
// The response stream has completed

ReadRows(String, Int64, CallSettings)

public virtual BigQueryReadClient.ReadRowsStream ReadRows(string readStream, long offset, CallSettings callSettings = null)

Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail.

Each request also returns a set of stream statistics reflecting the current state of the stream.

Parameters
NameDescription
readStreamString

Required. Stream to read rows from.

offsetInt64

The offset requested must be less than the last row read from Read. Requesting a larger offset is undefined. If not specified, start reading from offset zero.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BigQueryReadClient.ReadRowsStream

The server stream.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
string readStream = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]/streams/[STREAM]";
long offset = 0L;
// Make the request, returning a streaming response
BigQueryReadClient.ReadRowsStream response = bigQueryReadClient.ReadRows(readStream, offset);

// Read streaming responses from server until complete
// Note that C# 8 code can use await foreach
AsyncResponseStream<ReadRowsResponse> responseStream = response.GetResponseStream();
while (await responseStream.MoveNextAsync())
{
    ReadRowsResponse responseItem = responseStream.Current;
    // Do something with streamed response
}
// The response stream has completed

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

SplitReadStream(SplitReadStreamRequest, CallSettings)

public virtual SplitReadStreamResponse SplitReadStream(SplitReadStreamRequest request, CallSettings callSettings = null)

Splits a given ReadStream into two ReadStream objects. These ReadStream objects are referred to as the primary and the residual streams of the split. The original ReadStream can still be read from in the same manner as before. Both of the returned ReadStream objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back-to-back in the original ReadStream. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.

Parameters
NameDescription
requestSplitReadStreamRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SplitReadStreamResponse

The RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
SplitReadStreamRequest request = new SplitReadStreamRequest
{
    ReadStreamName = ReadStreamName.FromProjectLocationSessionStream("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]"),
    Fraction = 0,
};
// Make the request
SplitReadStreamResponse response = bigQueryReadClient.SplitReadStream(request);

SplitReadStreamAsync(SplitReadStreamRequest, CallSettings)

public virtual Task<SplitReadStreamResponse> SplitReadStreamAsync(SplitReadStreamRequest request, CallSettings callSettings = null)

Splits a given ReadStream into two ReadStream objects. These ReadStream objects are referred to as the primary and the residual streams of the split. The original ReadStream can still be read from in the same manner as before. Both of the returned ReadStream objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back-to-back in the original ReadStream. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.

Parameters
NameDescription
requestSplitReadStreamRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SplitReadStreamResponse>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
SplitReadStreamRequest request = new SplitReadStreamRequest
{
    ReadStreamName = ReadStreamName.FromProjectLocationSessionStream("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]"),
    Fraction = 0,
};
// Make the request
SplitReadStreamResponse response = await bigQueryReadClient.SplitReadStreamAsync(request);

SplitReadStreamAsync(SplitReadStreamRequest, CancellationToken)

public virtual Task<SplitReadStreamResponse> SplitReadStreamAsync(SplitReadStreamRequest request, CancellationToken cancellationToken)

Splits a given ReadStream into two ReadStream objects. These ReadStream objects are referred to as the primary and the residual streams of the split. The original ReadStream can still be read from in the same manner as before. Both of the returned ReadStream objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back-to-back in the original ReadStream. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.

Parameters
NameDescription
requestSplitReadStreamRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SplitReadStreamResponse>

A Task containing the RPC response.

Example
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
SplitReadStreamRequest request = new SplitReadStreamRequest
{
    ReadStreamName = ReadStreamName.FromProjectLocationSessionStream("[PROJECT]", "[LOCATION]", "[SESSION]", "[STREAM]"),
    Fraction = 0,
};
// Make the request
SplitReadStreamResponse response = await bigQueryReadClient.SplitReadStreamAsync(request);