BigQuery Read API.
The Read API can be used to read data from BigQuery. v1
Package
@google-cloud/bigquery-storage!
Constructors
(constructor)(opts)
constructor(opts?: ClientOptions);
Construct an instance of BigQueryReadClient.
Parameter
Name | Description |
opts |
ClientOptions
|
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
Property Value
auth
Property Value
Type | Description |
gax.GoogleAuth | |
bigQueryReadStub
bigQueryReadStub?: Promise<{
[name: string]: Function;
}>;
Property Value
Type | Description |
Promise<{
[name: string]: Function;
}> | |
descriptors
descriptors: Descriptors;
Property Value
Type | Description |
Descriptors | |
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
Property Value
Type | Description |
{
[name: string]: Function;
} | |
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
Property Value
Type | Description |
{
[name: string]: gax.PathTemplate;
} | |
port
static get port(): number;
The port for this API service.
Property Value
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
Property Value
servicePath
static get servicePath(): string;
The DNS address for this API service.
Property Value
Methods
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed.
|
createReadSession(request, options)
createReadSession(request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IReadSession, (protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined), {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.cloud.bigquery.storage.v1.IReadSession, (protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined), {} | undefined]> | |
createReadSession(request, options, callback)
createReadSession(request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>
|
Returns
createReadSession(request, callback)
createReadSession(request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest
|
callback |
Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>
|
Returns
getProjectId()
getProjectId(): Promise<string>;
Returns
Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub.
|
matchLocationFromReadSessionName(readSessionName)
matchLocationFromReadSessionName(readSessionName: string): string | number;
Parse the location from ReadSession resource.
Parameter
Name | Description |
readSessionName |
string
A fully-qualified path representing ReadSession resource.
|
Returns
Type | Description |
string | number | {string} A string representing the location.
|
matchLocationFromReadStreamName(readStreamName)
matchLocationFromReadStreamName(readStreamName: string): string | number;
Parse the location from ReadStream resource.
Parameter
Name | Description |
readStreamName |
string
A fully-qualified path representing ReadStream resource.
|
Returns
Type | Description |
string | number | {string} A string representing the location.
|
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter
Name | Description |
projectName |
string
A fully-qualified path representing Project resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchProjectFromReadSessionName(readSessionName)
matchProjectFromReadSessionName(readSessionName: string): string | number;
Parse the project from ReadSession resource.
Parameter
Name | Description |
readSessionName |
string
A fully-qualified path representing ReadSession resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchProjectFromReadStreamName(readStreamName)
matchProjectFromReadStreamName(readStreamName: string): string | number;
Parse the project from ReadStream resource.
Parameter
Name | Description |
readStreamName |
string
A fully-qualified path representing ReadStream resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchSessionFromReadSessionName(readSessionName)
matchSessionFromReadSessionName(readSessionName: string): string | number;
Parse the session from ReadSession resource.
Parameter
Name | Description |
readSessionName |
string
A fully-qualified path representing ReadSession resource.
|
Returns
Type | Description |
string | number | {string} A string representing the session.
|
matchSessionFromReadStreamName(readStreamName)
matchSessionFromReadStreamName(readStreamName: string): string | number;
Parse the session from ReadStream resource.
Parameter
Name | Description |
readStreamName |
string
A fully-qualified path representing ReadStream resource.
|
Returns
Type | Description |
string | number | {string} A string representing the session.
|
matchStreamFromReadStreamName(readStreamName)
matchStreamFromReadStreamName(readStreamName: string): string | number;
Parse the stream from ReadStream resource.
Parameter
Name | Description |
readStreamName |
string
A fully-qualified path representing ReadStream resource.
|
Returns
Type | Description |
string | number | {string} A string representing the stream.
|
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter
Name | Description |
project |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
readRows(request, options)
readRows(request?: protos.google.cloud.bigquery.storage.v1.IReadRowsRequest, options?: CallOptions): gax.CancellableStream;
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 |
protos.google.cloud.bigquery.storage.v1.IReadRowsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
gax.CancellableStream | {Stream} An object stream which emits [ReadRowsResponse] on 'data' event. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) for more details and examples.
|
readSessionPath(project, location, session)
readSessionPath(project: string, location: string, session: string): string;
Return a fully-qualified readSession resource name string.
Parameters
Name | Description |
project |
string
|
location |
string
|
session |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
readStreamPath(project, location, session, stream)
readStreamPath(project: string, location: string, session: string, stream: string): string;
Return a fully-qualified readStream resource name string.
Parameters
Name | Description |
project |
string
|
location |
string
|
session |
string
|
stream |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
splitReadStream(request, options)
splitReadStream(request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, (protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined), {} | undefined]>;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest
|
options |
CallOptions
|
Returns
Type | Description |
Promise<[protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, (protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined), {} | undefined]> | |
splitReadStream(request, options, callback)
splitReadStream(request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>
|
Returns
splitReadStream(request, callback)
splitReadStream(request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest
|
callback |
Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>
|
Returns