Class v1.BigQueryReadClient (2.3.0)

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
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

bigQueryReadStub

bigQueryReadStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
TypeDescription
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
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
NameDescription
request protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest
options CallOptions
Returns
TypeDescription
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
NameDescription
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
TypeDescription
void

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
NameDescription
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
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

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
TypeDescription
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
NameDescription
readSessionName string

A fully-qualified path representing ReadSession resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromReadStreamName(readStreamName)

matchLocationFromReadStreamName(readStreamName: string): string | number;

Parse the location from ReadStream resource.

Parameter
NameDescription
readStreamName string

A fully-qualified path representing ReadStream resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromReadSessionName(readSessionName)

matchProjectFromReadSessionName(readSessionName: string): string | number;

Parse the project from ReadSession resource.

Parameter
NameDescription
readSessionName string

A fully-qualified path representing ReadSession resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromReadStreamName(readStreamName)

matchProjectFromReadStreamName(readStreamName: string): string | number;

Parse the project from ReadStream resource.

Parameter
NameDescription
readStreamName string

A fully-qualified path representing ReadStream resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchSessionFromReadSessionName(readSessionName)

matchSessionFromReadSessionName(readSessionName: string): string | number;

Parse the session from ReadSession resource.

Parameter
NameDescription
readSessionName string

A fully-qualified path representing ReadSession resource.

Returns
TypeDescription
string | number

{string} A string representing the session.

matchSessionFromReadStreamName(readStreamName)

matchSessionFromReadStreamName(readStreamName: string): string | number;

Parse the session from ReadStream resource.

Parameter
NameDescription
readStreamName string

A fully-qualified path representing ReadStream resource.

Returns
TypeDescription
string | number

{string} A string representing the session.

matchStreamFromReadStreamName(readStreamName)

matchStreamFromReadStreamName(readStreamName: string): string | number;

Parse the stream from ReadStream resource.

Parameter
NameDescription
readStreamName string

A fully-qualified path representing ReadStream resource.

Returns
TypeDescription
string | number

{string} A string representing the stream.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
project string
location string
session string
Returns
TypeDescription
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
NameDescription
project string
location string
session string
stream string
Returns
TypeDescription
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
NameDescription
request protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest
options CallOptions
Returns
TypeDescription
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
NameDescription
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
TypeDescription
void

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
NameDescription
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
TypeDescription
void