Class managedwriter.Writer (4.3.0)

A BigQuery Storage API Writer that can be used to write data into BigQuery Table using the Storage API.

managedwriter

Package

@google-cloud/bigquery-storage

Constructors

(constructor)(params)

constructor(params: {
        connection: StreamConnection;
        protoDescriptor: IDescriptorProto;
    });

Creates a new Writer instance.

Parameter
NameDescription
params { connection: StreamConnection; protoDescriptor: IDescriptorProto; }

The parameters for the JSONWriter.

Methods

appendRows(rows, offsetValue)

appendRows(rows: ProtoData['rows'], offsetValue?: IInt64Value['value']): PendingWrite;

Schedules the writing of rows at given offset.

Parameters
NameDescription
rows ProtoData['rows']

the rows in serialized format to write to BigQuery.

offsetValue IInt64Value_2['value']

the offset of the first row.

Returns
TypeDescription
PendingWrite

{managedwriter.PendingWrite} The pending write

close()

close(): void;
Returns
TypeDescription
void

setProtoDescriptor(protoDescriptor)

setProtoDescriptor(protoDescriptor: IDescriptorProto): void;

Update the proto descriptor for the Writer. Internally a reconnection event is gonna happen to apply the new proto descriptor.

Parameter
NameDescription
protoDescriptor IDescriptorProto

The proto descriptor.

Returns
TypeDescription
void