fix(node): allow bigint[] for takeRowIds#2916
Merged
wjones127 merged 5 commits intolancedb:mainfrom Feb 3, 2026
Merged
Conversation
Change takeRowIds to accept bigint[] instead of number[], matching the type of _rowid returned by withRowId(). Previously, attempting to use row IDs obtained from withRowId() would fail with 'Failed to convert napi value BigInt into rust type i64' because the NAPI binding expected number[] while _rowid values are returned as bigint. Fixes lancedb#2722
wjones127
requested changes
Jan 30, 2026
Contributor
wjones127
left a comment
There was a problem hiding this comment.
Could you add a unit test for this?
- Test bigint[] input (main use case from issue lancedb#2722) - Test number[] input for backwards compatibility - Test mixed bigint/number arrays - Test validation: non-integer, negative, unsafe large numbers - Test negative bigint rejection from Rust layer
Contributor
Author
|
I'll add tests that cover using bigint[] directly, using number[] for backwards compatibility and validation errors for invalid inputs. |
wjones127
approved these changes
Feb 3, 2026
Contributor
wjones127
left a comment
There was a problem hiding this comment.
Looks excellent. Thanks! Will merge once CI is passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR changes takeRowIds to accept bigint[] instead of
number[], matching the type of _rowid returned by withRowId().
Problem
When retrieving row IDs using \withRowId()\ and querying them back with takeRowIds(), users get an error because:
Reproduction
\\js
import lancedb from '@lancedb/lancedb';
const db = await lancedb.connect('memory://');
const table = await db.createTable('test', [{ id: 1, vector: [1.0, 2.0] }]);
const results = await table.query().withRowId().toArray();
const rowIds = results.map(row => row._rowid);
console.log('types:', rowIds.map(id => typeof id)); // ['bigint']
await table.takeRowIds(rowIds).toArray(); // � Error before fix
\\
Solution
Fixes #2722