public abstract class BigQueryReadClient
Reference documentation and code samples for the Google BigQuery Storage v1 API class BigQueryReadClient.
BigQueryRead client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.BigQuery.Storage.V1Assembly
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 | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default BigQueryRead scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default BigQueryRead scopes are:
GrpcClient
public virtual BigQueryRead.BigQueryReadClient GrpcClient { get; }
The underlying gRPC BigQueryRead client
Property Value | |
---|---|
Type | Description |
BigQueryRead.BigQueryReadClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | ProjectName Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReadSession | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateReadSessionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReadSession | The RPC response. |
// Create client
BigQueryReadClient bigQueryReadClient = BigQueryReadClient.Create();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
ReadSession = new ReadSession(),
MaxStreamCount = 0,
PreferredMinStreamCount = 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 | |
---|---|
Name | Description |
parent | String Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReadSession | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | ProjectName Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | ProjectName Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateReadSessionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
ReadSession = new ReadSession(),
MaxStreamCount = 0,
PreferredMinStreamCount = 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 | |
---|---|
Name | Description |
request | CreateReadSessionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// Create client
BigQueryReadClient bigQueryReadClient = await BigQueryReadClient.CreateAsync();
// Initialize request argument(s)
CreateReadSessionRequest request = new CreateReadSessionRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
ReadSession = new ReadSession(),
MaxStreamCount = 0,
PreferredMinStreamCount = 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 | |
---|---|
Name | Description |
parent | String Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The request project that owns the session, in the form of
|
readSession | ReadSession Required. Session to be created. |
maxStreamCount | Int32 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. There is a default system max limit of 1,000. This must be greater than or equal to preferred_min_stream_count. Typically, clients should either leave this unset to let the system to determine an upper bound OR set this a size for the maximum "units of work" it can gracefully handle. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<ReadSession> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | ReadRowsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
BigQueryReadClient.ReadRowsStream | The server stream. |
// 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 | |
---|---|
Name | Description |
readStream | ReadStreamName Required. Stream to read rows from. |
offset | Int64 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
BigQueryReadClient.ReadRowsStream | The server stream. |
// 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 | |
---|---|
Name | Description |
readStream | String Required. Stream to read rows from. |
offset | Int64 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. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
BigQueryReadClient.ReadRowsStream | The server stream. |
// 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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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 | |
---|---|
Name | Description |
request | SplitReadStreamRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SplitReadStreamResponse | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | SplitReadStreamRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<SplitReadStreamResponse> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | SplitReadStreamRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<SplitReadStreamResponse> | A Task containing the RPC response. |
// 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);