From 1fdc05ceb184178f4e8577bff8f821fe88e10de9 Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Wed, 13 Mar 2024 15:58:35 -0400 Subject: [PATCH 1/6] feat: add support for default value interpretation --- src/managedwriter/json_writer.ts | 10 +++++++++- src/managedwriter/writer.ts | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/managedwriter/json_writer.ts b/src/managedwriter/json_writer.ts index 0afe5755..3087c1d0 100644 --- a/src/managedwriter/json_writer.ts +++ b/src/managedwriter/json_writer.ts @@ -19,6 +19,8 @@ import {StreamConnection, RemoveListener} from './stream_connection'; import * as adapt from '../adapt'; import {Writer} from './writer'; +type AppendRowRequest = + protos.google.cloud.bigquery.storage.v1.IAppendRowsRequest; type TableSchema = protos.google.cloud.bigquery.storage.v1.ITableSchema; type IInt64Value = protos.google.protobuf.IInt64Value; type IDescriptorProto = protos.google.protobuf.IDescriptorProto; @@ -58,12 +60,18 @@ export class JSONWriter { * @param {Object} params - The parameters for the JSONWriter. * @param {StreamConnection} params.connection - The stream connection * to the BigQuery streaming insert operation. - * @param {IDescriptorProto} params.protoDescriptor - The proto descriptor + * @param {AppendRowRequest['defaultMissingValueInterpretation']} params.defaultMissingValueInterpretation - controls how missing values are interpreted by + * for a given stream. + * @param {AppendRowRequest['missingValueInterpretations']} params.missingValueInterpretations - The proto descriptor * for the JSON rows. */ constructor(params: { connection: StreamConnection; protoDescriptor: IDescriptorProto; + defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; + missingValueInterpretations?: { + [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; + }; }) { const {connection, protoDescriptor} = params; this._writer = new Writer(params); diff --git a/src/managedwriter/writer.ts b/src/managedwriter/writer.ts index 1a090da6..15314da2 100644 --- a/src/managedwriter/writer.ts +++ b/src/managedwriter/writer.ts @@ -37,6 +37,10 @@ const DescriptorProto = protos.google.protobuf.DescriptorProto; export class Writer { private _protoDescriptor: DescriptorProto; private _streamConnection: StreamConnection; + private _defaultMissingValueInterpretation: AppendRowRequest['defaultMissingValueInterpretation']; + private _missingValueInterpretations: { + [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; + }; /** * Creates a new Writer instance. @@ -50,10 +54,21 @@ export class Writer { constructor(params: { connection: StreamConnection; protoDescriptor: IDescriptorProto; + defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; + missingValueInterpretations?: { + [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; + }; }) { - const {connection, protoDescriptor} = params; + const { + connection, + protoDescriptor, + missingValueInterpretations, + defaultMissingValueInterpretation, + } = params; this._streamConnection = connection; this._protoDescriptor = new DescriptorProto(protoDescriptor); + this._defaultMissingValueInterpretation = defaultMissingValueInterpretation; + this._missingValueInterpretations = missingValueInterpretations; } /** @@ -97,6 +112,9 @@ export class Writer { protoDescriptor: this._protoDescriptor.toJSON(), }, }, + defaultMissingValueInterpretation: + this._defaultMissingValueInterpretation, + missingValueInterpretations: this._missingValueInterpretations as AppendRowRequest['missingValueInterpretations'], offset, }; From f5b00ba75cf7fef21fd16497e7ce364abcc15f85 Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Fri, 15 Mar 2024 14:56:26 -0400 Subject: [PATCH 2/6] feat: add setter for missing value interpretation and docs --- src/managedwriter/json_writer.ts | 48 +++++++++------- src/managedwriter/writer.ts | 95 ++++++++++++++++++++++++++------ 2 files changed, 106 insertions(+), 37 deletions(-) diff --git a/src/managedwriter/json_writer.ts b/src/managedwriter/json_writer.ts index 3087c1d0..0e5e8c09 100644 --- a/src/managedwriter/json_writer.ts +++ b/src/managedwriter/json_writer.ts @@ -15,12 +15,10 @@ import * as protobuf from 'protobufjs'; import * as protos from '../../protos/protos'; import {PendingWrite} from './pending_write'; -import {StreamConnection, RemoveListener} from './stream_connection'; +import {RemoveListener} from './stream_connection'; import * as adapt from '../adapt'; -import {Writer} from './writer'; +import {Writer, WriterOptions} from './writer'; -type AppendRowRequest = - protos.google.cloud.bigquery.storage.v1.IAppendRowsRequest; type TableSchema = protos.google.cloud.bigquery.storage.v1.ITableSchema; type IInt64Value = protos.google.protobuf.IInt64Value; type IDescriptorProto = protos.google.protobuf.IDescriptorProto; @@ -57,22 +55,10 @@ export class JSONWriter { /** * Creates a new JSONWriter instance. * - * @param {Object} params - The parameters for the JSONWriter. - * @param {StreamConnection} params.connection - The stream connection - * to the BigQuery streaming insert operation. - * @param {AppendRowRequest['defaultMissingValueInterpretation']} params.defaultMissingValueInterpretation - controls how missing values are interpreted by - * for a given stream. - * @param {AppendRowRequest['missingValueInterpretations']} params.missingValueInterpretations - The proto descriptor - * for the JSON rows. + * @param {WriterOptions} params - The parameters for the JSONWriter. + * See WriterOptions docs for more information. */ - constructor(params: { - connection: StreamConnection; - protoDescriptor: IDescriptorProto; - defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; - missingValueInterpretations?: { - [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; - }; - }) { + constructor(params: WriterOptions) { const {connection, protoDescriptor} = params; this._writer = new Writer(params); this._schemaListener = connection.onSchemaUpdated(this.onSchemaUpdated); @@ -102,6 +88,30 @@ export class JSONWriter { this._writer.setProtoDescriptor(protoDescriptor); } + /** + * Update how missing values are interpreted by for the given stream. + * + * @param {WriterOptions['defaultMissingValueInterpretation']} defaultMissingValueInterpretation + */ + setDefaultMissingValueInterpretation( + defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation'] + ) { + this._writer.setDefaultMissingValueInterpretation( + defaultMissingValueInterpretation + ); + } + + /** + * Update how missing values are interpreted for individual columns. + * + * @param {WriterOptions['missingValueInterpretations']} missingValueInterpretations + */ + setMissingValueInterpretations( + missingValueInterpretations: WriterOptions['missingValueInterpretations'] + ) { + this._writer.setMissingValueInterpretations(missingValueInterpretations); + } + /** * 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 diff --git a/src/managedwriter/writer.ts b/src/managedwriter/writer.ts index 15314da2..f989230f 100644 --- a/src/managedwriter/writer.ts +++ b/src/managedwriter/writer.ts @@ -27,6 +27,54 @@ type DescriptorProto = protos.google.protobuf.DescriptorProto; const DescriptorProto = protos.google.protobuf.DescriptorProto; +export interface WriterOptions { + /** The stream connection to the BigQuery streaming insert operation. */ + connection: StreamConnection; + + /** The proto descriptor for the stream. */ + protoDescriptor: IDescriptorProto; + + /** + * Controls how missing values are interpreted by for a given stream. + * `missingValueInterpretations` set for individual colums can override the default chosen + * with this option. + * + * For example, if you want to write + * `NULL` instead of using default values for some columns, you can set + * `defaultMissingValueInterpretation` to `DEFAULT_VALUE` and at the same + * time, set `missingValueInterpretations` to `NULL_VALUE` on those columns. + */ + defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; + + /** + * Control how missing values are interpreted for individual columns. + * + * You must provide an object to indicate how to interpret missing value for some fields. Missing + * values are fields present in user schema but missing in rows. The key is + * the field name. The value is the interpretation of missing values for the + * field. + * + * For example, the following option would indicate that missing values in the "foo" + * column are interpreted as null, whereas missing values in the "bar" column are + * treated as the default value: + * + * { + * "foo": 'DEFAULT_VALUE', + * "bar": 'NULL_VALUE', + * } + * + * If a field is not in this object and has missing values, the missing values + * in this field are interpreted as NULL unless overridden with a default missing + * value interpretation. + * + * Currently, field name can only be top-level column name, can't be a struct + * field path like 'foo.bar'. + */ + missingValueInterpretations?: { + [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; + }; +} + /** * A BigQuery Storage API Writer that can be used to write data into BigQuery Table * using the Storage API. @@ -37,28 +85,16 @@ const DescriptorProto = protos.google.protobuf.DescriptorProto; export class Writer { private _protoDescriptor: DescriptorProto; private _streamConnection: StreamConnection; - private _defaultMissingValueInterpretation: AppendRowRequest['defaultMissingValueInterpretation']; - private _missingValueInterpretations: { - [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; - }; + private _defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation']; + private _missingValueInterpretations?: WriterOptions['missingValueInterpretations']; /** * Creates a new Writer instance. * - * @param {Object} params - The parameters for the JSONWriter. - * @param {StreamConnection} params.connection - The stream connection - * to the BigQuery streaming insert operation. - * @param {IDescriptorProto} params.protoDescriptor - The proto descriptor - * for the JSON rows. + * @param {WriterOptions} params - The parameters for the Writer. + * See WriterOptions docs for more information. */ - constructor(params: { - connection: StreamConnection; - protoDescriptor: IDescriptorProto; - defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; - missingValueInterpretations?: { - [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; - }; - }) { + constructor(params: WriterOptions) { const { connection, protoDescriptor, @@ -87,6 +123,28 @@ export class Writer { } } + /** + * Update how missing values are interpreted by for the given stream. + * + * @param {WriterOptions['defaultMissingValueInterpretation']} defaultMissingValueInterpretation + */ + setDefaultMissingValueInterpretation( + defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation'] + ) { + this._defaultMissingValueInterpretation = defaultMissingValueInterpretation; + } + + /** + * Update how missing values are interpreted for individual columns. + * + * @param {WriterOptions['missingValueInterpretations']} missingValueInterpretations + */ + setMissingValueInterpretations( + missingValueInterpretations: WriterOptions['missingValueInterpretations'] + ) { + this._missingValueInterpretations = missingValueInterpretations; + } + /** * Schedules the writing of rows at given offset. * @@ -114,7 +172,8 @@ export class Writer { }, defaultMissingValueInterpretation: this._defaultMissingValueInterpretation, - missingValueInterpretations: this._missingValueInterpretations as AppendRowRequest['missingValueInterpretations'], + missingValueInterpretations: this + ._missingValueInterpretations as AppendRowRequest['missingValueInterpretations'], offset, }; From 2fb067fc87980062ae9d53991dbcf77bfa8eebfd Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Fri, 15 Mar 2024 15:14:20 -0400 Subject: [PATCH 3/6] fix: missing value docs --- src/managedwriter/json_writer.ts | 13 +++++++++---- src/managedwriter/writer.ts | 23 +++++++++++++---------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/managedwriter/json_writer.ts b/src/managedwriter/json_writer.ts index 0e5e8c09..cd22dd23 100644 --- a/src/managedwriter/json_writer.ts +++ b/src/managedwriter/json_writer.ts @@ -20,6 +20,11 @@ import * as adapt from '../adapt'; import {Writer, WriterOptions} from './writer'; type TableSchema = protos.google.cloud.bigquery.storage.v1.ITableSchema; +type MissingValueInterpretation = + protos.google.cloud.bigquery.storage.v1.AppendRowsRequest['defaultMissingValueInterpretation']; +type MissingValueInterpretationMap = { + [column: string]: MissingValueInterpretation; +}; type IInt64Value = protos.google.protobuf.IInt64Value; type IDescriptorProto = protos.google.protobuf.IDescriptorProto; type DescriptorProto = protos.google.protobuf.DescriptorProto; @@ -91,10 +96,10 @@ export class JSONWriter { /** * Update how missing values are interpreted by for the given stream. * - * @param {WriterOptions['defaultMissingValueInterpretation']} defaultMissingValueInterpretation + * @param {MissingValueInterpretation} defaultMissingValueInterpretation */ setDefaultMissingValueInterpretation( - defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation'] + defaultMissingValueInterpretation: MissingValueInterpretation ) { this._writer.setDefaultMissingValueInterpretation( defaultMissingValueInterpretation @@ -104,10 +109,10 @@ export class JSONWriter { /** * Update how missing values are interpreted for individual columns. * - * @param {WriterOptions['missingValueInterpretations']} missingValueInterpretations + * @param {MissingValueInterpretationMap} missingValueInterpretations */ setMissingValueInterpretations( - missingValueInterpretations: WriterOptions['missingValueInterpretations'] + missingValueInterpretations: MissingValueInterpretationMap ) { this._writer.setMissingValueInterpretations(missingValueInterpretations); } diff --git a/src/managedwriter/writer.ts b/src/managedwriter/writer.ts index f989230f..6bff874b 100644 --- a/src/managedwriter/writer.ts +++ b/src/managedwriter/writer.ts @@ -24,6 +24,11 @@ type ProtoData = protos.google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData; type IDescriptorProto = protos.google.protobuf.IDescriptorProto; type DescriptorProto = protos.google.protobuf.DescriptorProto; +type MissingValueInterpretation = + AppendRowRequest['defaultMissingValueInterpretation']; +type MissingValueInterpretationMap = { + [column: string]: MissingValueInterpretation; +}; const DescriptorProto = protos.google.protobuf.DescriptorProto; @@ -44,7 +49,7 @@ export interface WriterOptions { * `defaultMissingValueInterpretation` to `DEFAULT_VALUE` and at the same * time, set `missingValueInterpretations` to `NULL_VALUE` on those columns. */ - defaultMissingValueInterpretation?: AppendRowRequest['defaultMissingValueInterpretation']; + defaultMissingValueInterpretation?: MissingValueInterpretation; /** * Control how missing values are interpreted for individual columns. @@ -70,9 +75,7 @@ export interface WriterOptions { * Currently, field name can only be top-level column name, can't be a struct * field path like 'foo.bar'. */ - missingValueInterpretations?: { - [k: string]: AppendRowRequest['defaultMissingValueInterpretation']; - }; + missingValueInterpretations?: MissingValueInterpretationMap; } /** @@ -85,8 +88,8 @@ export interface WriterOptions { export class Writer { private _protoDescriptor: DescriptorProto; private _streamConnection: StreamConnection; - private _defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation']; - private _missingValueInterpretations?: WriterOptions['missingValueInterpretations']; + private _defaultMissingValueInterpretation?: MissingValueInterpretation; + private _missingValueInterpretations?: MissingValueInterpretationMap; /** * Creates a new Writer instance. @@ -126,10 +129,10 @@ export class Writer { /** * Update how missing values are interpreted by for the given stream. * - * @param {WriterOptions['defaultMissingValueInterpretation']} defaultMissingValueInterpretation + * @param {MissingValueInterpretation} defaultMissingValueInterpretation */ setDefaultMissingValueInterpretation( - defaultMissingValueInterpretation: WriterOptions['defaultMissingValueInterpretation'] + defaultMissingValueInterpretation: MissingValueInterpretation ) { this._defaultMissingValueInterpretation = defaultMissingValueInterpretation; } @@ -137,10 +140,10 @@ export class Writer { /** * Update how missing values are interpreted for individual columns. * - * @param {WriterOptions['missingValueInterpretations']} missingValueInterpretations + * @param {MissingValueInterpretationMap} missingValueInterpretations */ setMissingValueInterpretations( - missingValueInterpretations: WriterOptions['missingValueInterpretations'] + missingValueInterpretations: MissingValueInterpretationMap ) { this._missingValueInterpretations = missingValueInterpretations; } From 770e4ca17be5f947a699e25a1ebe03d5cd91f3ec Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Fri, 15 Mar 2024 16:17:39 -0400 Subject: [PATCH 4/6] test: default value interpretation system test --- system-test/managed_writer_client_test.ts | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/system-test/managed_writer_client_test.ts b/system-test/managed_writer_client_test.ts index 7b7dfa0b..c24610bc 100644 --- a/system-test/managed_writer_client_test.ts +++ b/system-test/managed_writer_client_test.ts @@ -554,6 +554,105 @@ describe('managedwriter.WriterClient', () => { }).timeout(30 * 1000); }); + it('should fill default values when MissingValuesInterpretation is set', async () => { + bqWriteClient.initialize(); + const client = new WriterClient(); + client.setClient(bqWriteClient); + + const updatedSchema: TableSchema = { + fields: [ + ...(schema.fields || []), + { + name: 'id', + type: 'STRING', + defaultValueExpression: 'GENERATE_UUID()', + }, + { + name: 'created_at', + type: 'TIMESTAMP', + defaultValueExpression: 'CURRENT_TIMESTAMP()', + }, + { + name: 'updated_at', + type: 'TIMESTAMP', + defaultValueExpression: 'CURRENT_TIMESTAMP()', + }, + ], + }; + const [table] = await bigquery + .dataset(datasetId) + .createTable(tableId + '_default_values', {schema: updatedSchema}); + const parent = `projects/${projectId}/datasets/${datasetId}/tables/${table.id}`; + + const storageSchema = + adapt.convertBigQuerySchemaToStorageTableSchema(updatedSchema); + const protoDescriptor: DescriptorProto = + adapt.convertStorageSchemaToProto2Descriptor(storageSchema, 'root'); + + // Row 1 + const row1 = { + customer_name: 'Ada Lovelace', + row_num: 1, + }; + + // Row 2 + const row2 = { + customer_name: 'Alan Turing', + row_num: 2, + }; + + try { + const connection = await client.createStreamConnection({ + streamType: managedwriter.PendingStream, + destinationTable: parent, + }); + + const streamId = connection.getStreamId(); + const writer = new JSONWriter({ + connection, + protoDescriptor, + defaultMissingValueInterpretation: 'DEFAULT_VALUE', + missingValueInterpretations: { + updated_at: 'NULL_VALUE', + }, + }); + + const pw = writer.appendRows([row1, row2], 0); + const result = await pw.getResult(); + + assert.equal(result.error, null); + + const res = await connection.finalize(); + connection.close(); + assert.equal(res?.rowCount, 2); + + const commitResponse = await client.batchCommitWriteStream({ + parent, + writeStreams: [streamId], + }); + assert.equal(commitResponse.streamErrors?.length, 0); + + const [rows] = await bigquery.query( + `SELECT * FROM \`${projectId}.${datasetId}.${table.id}\` order by row_num` + ); + + assert.strictEqual(rows.length, 2); + const first = rows[0]; + assert.notEqual(first.id, null); + assert.notEqual(first.created_at, null); + assert.equal(first.updated_at, null); + + const second = rows[1]; + assert.notEqual(second.id, null); + assert.notEqual(second.created_at, null); + assert.equal(second.updated_at, null); + + writer.close(); + } finally { + client.close(); + } + }); + describe('Error Scenarios', () => { it('send request with mismatched proto descriptor', async () => { bqWriteClient.initialize(); From 62e18797052a97705f9d352cb076d9e83cc5b0a5 Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Wed, 20 Mar 2024 12:14:19 -0400 Subject: [PATCH 5/6] test: improve MVI test with changing MVI value after writes started --- system-test/managed_writer_client_test.ts | 57 +++++++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/system-test/managed_writer_client_test.ts b/system-test/managed_writer_client_test.ts index c24610bc..3fa5c103 100644 --- a/system-test/managed_writer_client_test.ts +++ b/system-test/managed_writer_client_test.ts @@ -559,9 +559,18 @@ describe('managedwriter.WriterClient', () => { const client = new WriterClient(); client.setClient(bqWriteClient); - const updatedSchema: TableSchema = { + const schema: TableSchema = { fields: [ - ...(schema.fields || []), + { + name: 'customer_name', + type: 'STRING', + mode: 'REQUIRED', + }, + { + name: 'row_num', + type: 'INTEGER', + mode: 'REQUIRED', + }, { name: 'id', type: 'STRING', @@ -581,21 +590,19 @@ describe('managedwriter.WriterClient', () => { }; const [table] = await bigquery .dataset(datasetId) - .createTable(tableId + '_default_values', {schema: updatedSchema}); + .createTable(tableId + '_default_values', {schema}); const parent = `projects/${projectId}/datasets/${datasetId}/tables/${table.id}`; const storageSchema = - adapt.convertBigQuerySchemaToStorageTableSchema(updatedSchema); + adapt.convertBigQuerySchemaToStorageTableSchema(schema); const protoDescriptor: DescriptorProto = adapt.convertStorageSchemaToProto2Descriptor(storageSchema, 'root'); - // Row 1 const row1 = { customer_name: 'Ada Lovelace', row_num: 1, }; - // Row 2 const row2 = { customer_name: 'Alan Turing', row_num: 2, @@ -617,14 +624,33 @@ describe('managedwriter.WriterClient', () => { }, }); - const pw = writer.appendRows([row1, row2], 0); - const result = await pw.getResult(); + let pw = writer.appendRows([row1, row2], 0); + let result = await pw.getResult(); + + // change MVI config + writer.setDefaultMissingValueInterpretation('NULL_VALUE'); + writer.setMissingValueInterpretations({ + updated_at: 'DEFAULT_VALUE', + }); + + const row3 = { + customer_name: 'Charles Babbage', + row_num: 3, + }; + + const row4 = { + customer_name: 'Lord Byron', + row_num: 4, + }; + + pw = writer.appendRows([row3, row4], 2); + result = await pw.getResult(); assert.equal(result.error, null); const res = await connection.finalize(); connection.close(); - assert.equal(res?.rowCount, 2); + assert.equal(res?.rowCount, 4); const commitResponse = await client.batchCommitWriteStream({ parent, @@ -635,8 +661,8 @@ describe('managedwriter.WriterClient', () => { const [rows] = await bigquery.query( `SELECT * FROM \`${projectId}.${datasetId}.${table.id}\` order by row_num` ); + assert.strictEqual(rows.length, 4); - assert.strictEqual(rows.length, 2); const first = rows[0]; assert.notEqual(first.id, null); assert.notEqual(first.created_at, null); @@ -647,6 +673,17 @@ describe('managedwriter.WriterClient', () => { assert.notEqual(second.created_at, null); assert.equal(second.updated_at, null); + // After change on MVI config + const third = rows[2]; + assert.equal(third.id, null); + assert.equal(third.created_at, null); + assert.notEqual(third.updated_at, null); + + const forth = rows[3]; + assert.equal(forth.id, null); + assert.equal(forth.created_at, null); + assert.notEqual(forth.updated_at, null); + writer.close(); } finally { client.close(); From d3d9263876bea027b2d2bbbce5772c4a969d198a Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Thu, 21 Mar 2024 13:35:43 -0400 Subject: [PATCH 6/6] fix: remove extra by/for on comments --- src/managedwriter/json_writer.ts | 2 +- src/managedwriter/writer.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/managedwriter/json_writer.ts b/src/managedwriter/json_writer.ts index 158f5da4..f187c26c 100644 --- a/src/managedwriter/json_writer.ts +++ b/src/managedwriter/json_writer.ts @@ -88,7 +88,7 @@ export class JSONWriter { } /** - * Update how missing values are interpreted by for the given stream. + * Update how missing values are interpreted for the given stream. * * @param {MissingValueInterpretation} defaultMissingValueInterpretation */ diff --git a/src/managedwriter/writer.ts b/src/managedwriter/writer.ts index 6bff874b..04939e07 100644 --- a/src/managedwriter/writer.ts +++ b/src/managedwriter/writer.ts @@ -40,8 +40,8 @@ export interface WriterOptions { protoDescriptor: IDescriptorProto; /** - * Controls how missing values are interpreted by for a given stream. - * `missingValueInterpretations` set for individual colums can override the default chosen + * Controls how missing values are interpreted for a given stream. + * `missingValueInterpretations` set for individual columns can override the default chosen * with this option. * * For example, if you want to write @@ -127,7 +127,7 @@ export class Writer { } /** - * Update how missing values are interpreted by for the given stream. + * Update how missing values are interpreted for the given stream. * * @param {MissingValueInterpretation} defaultMissingValueInterpretation */