Alfred-Mountfield commented on a change in pull request #12451:
URL: https://github.com/apache/arrow/pull/12451#discussion_r810402923



##########
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:
       I've just tested it locally and that seems to work :) although with 
`valid` instead of value` in `if (!super.setValid(index, value)`
   
   There doesn't seem to be documentation on the `setValid` method on `Builder` 
however, so I'm not sure what doc it's inheriting
   
   I've pushed the update




-- 
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


Reply via email to