Constructor
new JSONEncoder(params)
Creates a new JSONEncoder instance.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
The parameters for the JSONEncoder. Properties
|
Methods
encodeRows(rows) → {Array.<Uint8Array>}
Writes a JSONList that contains objects to be written to the BigQuery table by first converting the JSON data to protobuf messages, then using Writer's appendRows() to write the data at current end of stream. If there is a schema update, the current Writer is closed and reopened with the updated schema.
Parameters:
Name | Type | Description |
---|---|---|
rows |
JSONList |
The list of JSON rows. |
Returns:
Type | Description |
---|---|
Array.<Uint8Array> |
The encoded rows. |
setProtoDescriptor(protoDescriptor)
Update the proto descriptor for the Encoder.
Parameters:
Name | Type | Description |
---|---|---|
protoDescriptor |
IDescriptorProto |
The proto descriptor. |