Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/src/builder/union.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export abstract class UnionBuilder<T extends Union, TNull = any> extends Builder
const childIndex = this.type.typeIdToChildIndex[childTypeId!];
const child = this.children[childIndex];
child?.set(index, value);
this.length = Math.max(index + 1, this.length);
}

public addChild(child: Builder, name = `${this.children.length}`) {
Expand Down Expand Up @@ -93,5 +94,6 @@ export class DenseUnionBuilder<T extends DenseUnion, TNull = any> extends UnionB
const child = this.getChildAt(this.type.typeIdToChildIndex[id])!;
const denseIndex = this._offsets.set(index, child.length).buffer[index];
child?.set(denseIndex, value);
this.length = Math.max(index + 1, this.length);
}
}
1 change: 1 addition & 0 deletions js/test/unit/builders/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export function validateVector<T extends DataType>(vals: (T['TValue'] | null)[],
let i = 0, x: T['TValue'] | null, y: T['TValue'] | null;
const nulls = nullVals.reduce((m, x) => m.set(x, x), new Map());
try {
expect(vec).toHaveLength(vals.length);
for (x of vec) {
if (nulls.has(y = vals[i])) {
expect(x).toBeNull();
Expand Down
Loading