Class reader.TableReader (4.10.0)

A BigQuery Storage API Reader that can be used to reader data into BigQuery Table using the Storage API.

reader

Package

@google-cloud/bigquery-storage

Constructors

(constructor)(readClient, tableRef)

constructor(readClient: ReadClient, tableRef: TableReference);

Creates a new Reader instance.

Parameters
Name Description
readClient ReadClient
tableRef TableReference

Methods

close()

close(): void;
Returns
Type Description
void

getRows(options)

getRows(options?: GetRowsOptions): Promise<RowsResponse>;

Retrieves table data as rows in same format as tabledata.list BigQuery v2 API. Extra parameters returned contain Storage Read API specific information like ReadSession and totalRows count.

Parameter
Name Description
options GetRowsOptions
Returns
Type Description
Promise<RowsResponse>

getRowStream(options)

getRowStream(options?: GetRowsOptions): Promise<ResourceStream<TableRow>>;
Parameter
Name Description
options GetRowsOptions
Returns
Type Description
Promise<ResourceStream<TableRow>>

getSessionInfo()

getSessionInfo(): ReadSessionInfo | undefined | null;
Returns
Type Description
ReadSessionInfo | undefined | null