Alfred-Mountfield commented on a change in pull request #12451: URL: https://github.com/apache/arrow/pull/12451#discussion_r810379309
########## File path: js/src/builder/struct.ts ########## @@ -23,12 +23,31 @@ import { Struct, TypeMap } from '../type.js'; /** @ignore */ export class StructBuilder<T extends TypeMap = any, TNull = any> extends Builder<Struct<T>, TNull> { - public setValue(index: number, value: Struct<T>['TValue']) { + /** + * Write a value (or null-value sentinel) at the supplied index. + * If the value matches one of the null-value representations, a 1-bit is + * written to the null `BitmapBufferBuilder`, otherwise, a 0 is written. The + * value is then passed to `Builder.prototype.setValue()`. + * @param {number} index The index of the value to write. + * @param {T['TValue'] | TNull } value The value to write at the supplied index. + * @returns {this} The updated `Builder` instance. + */ + public set(index: number, value: Struct<T>['TValue'] | TNull) { + this.setValid(index, this.isValid(value)); + this.setValue(index, value); + return this; + } Review comment: Is `inheritdoc` correct here? I believe the inherited documentation would be misleading as it wouldn't mention calling the `setValid` function on the children. Also I'll admit I'm very unfamiliar with this codebase, is calling `setValid` good enough, I would have thought that doesn't work for more complex nested types such as a struct within a struct which would need the fields _of that inner-struct_ to also have a null value appended. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org