Skip to content

fix(java): align version type from i32 to u64#5892

Merged
majin1102 merged 1 commit intolance-format:mainfrom
majin1102:fix-java-version
Feb 6, 2026
Merged

fix(java): align version type from i32 to u64#5892
majin1102 merged 1 commit intolance-format:mainfrom
majin1102:fix-java-version

Conversation

@majin1102
Copy link
Copy Markdown
Contributor

This should be a mistake introduced long long ago

@github-actions github-actions Bot added bug Something isn't working java labels Feb 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

Code Review

Summary: This PR correctly fixes a type mismatch where the Java bindings were using int/Integer for dataset versions while the underlying Rust API uses u64.

Verdict: ✅ LGTM

The changes are straightforward and correct:

  1. Java ReadOptions.version changed from Optional<Integer> to Optional<Long>
  2. Java Dataset.openNative parameter updated accordingly
  3. JNI layer updated to use existing get_u64_opt() instead of get_int_opt()
  4. Rust BlockingDataset::open version parameter changed from Option<i32> to Option<u64>

The get_u64_opt() FFI helper already exists and correctly handles the Optional<Long> to Option<u64> conversion.

Existing tests using setVersion(1) will continue to work due to Java's implicit widening from int literals to long.

No issues found.

@majin1102 majin1102 merged commit c9ffc74 into lance-format:main Feb 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants