Class managedwriter.Writer (4.4.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: WriterOptions);

Creates a new Writer instance.

Parameter
NameDescription
params WriterOptions

The parameters for the Writer. See WriterOptions docs for more information.

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

setDefaultMissingValueInterpretation(defaultMissingValueInterpretation)

setDefaultMissingValueInterpretation(defaultMissingValueInterpretation: MissingValueInterpretation): void;

Update how missing values are interpreted for the given stream.

Parameter
NameDescription
defaultMissingValueInterpretation MissingValueInterpretation
Returns
TypeDescription
void

setMissingValueInterpretations(missingValueInterpretations)

setMissingValueInterpretations(missingValueInterpretations: MissingValueInterpretationMap): void;

Update how missing values are interpreted for individual columns.

Parameter
NameDescription
missingValueInterpretations MissingValueInterpretationMap
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