feat(java): expose manifest writer version - #8451
Conversation
There was a problem hiding this comment.
The Java/JNI mapping is a thin, faithful projection of the existing manifest contract. The non-blocking risk is regression coverage: the new test proves only a present library/core version, not legacy absence or prerelease/build qualifiers. Targeted fixture assertions would lock down the advertised boundary behavior.
| assertEquals(LanceConstants.FILE_FORMAT_VERSION_2_1, dataset.getLanceFileFormatVersion()); | ||
| WriterVersion writerVersion = dataset.getWriterVersion().orElseThrow(AssertionError::new); | ||
| assertEquals("lance", writerVersion.getLibrary()); | ||
| assertFalse(writerVersion.getVersion().isEmpty()); |
There was a problem hiding this comment.
The new API also promises Optional.empty() for legacy manifests and preserves prerelease/build qualifiers, but this coverage only exercises a newly written manifest’s present library/core version. Please add focused assertions for those boundary paths—existing legacy and prerelease fixtures can cover two of them—so JNI null/optional mapping regressions are caught.
There was a problem hiding this comment.
Partially addressed on 942f3fd: the historical v0.7.5 assertion now covers the JNI null → Optional.empty() path. The qualifier test constructs WriterVersion directly, so it would still pass if JNI swapped or dropped prerelease / buildMetadata; qualifier transport remains uncovered. This non-blocking thread remains open.
There was a problem hiding this comment.
Fixed on 7ae0f8e: the 2.0.0-beta.1 fixture now exercises prerelease presence and build-metadata absence through Dataset.getWriterVersion(). The focused suite passed 54 Java tests and 17 JNI Rust tests, closing the qualifier-mapping risk.
There was a problem hiding this comment.
Legacy absence is now covered end to end. The remaining non-blocking risk is that prerelease/build qualifier transport still lacks an end-to-end Java/JNI assertion; exercising a qualifier-bearing manifest through Dataset.getWriterVersion() would close it.
Summary
WriterVersionresult with optional prerelease and build metadataOptional.empty()for older manifests that do not contain writer-version metadataCompatibility coverage
DatasetTestexercises both compatibility directions through the publicDataset.getWriterVersion()JNI path:writer_versionreturnsOptional.empty()lance 2.0.0-beta.1manifest verifies that library, core version, prerelease, and absent build metadata arrive in the correct Java fieldsThe prerelease fixture assertion catches dropped or swapped qualifier fields in the Rust-to-Java mapping.
Testing
cd java && ./mvnw -Dtest=DatasetTest test(54 Java tests and 17 JNI Rust tests)cd java && cargo clippy --tests --manifest-path lance-jni/Cargo.toml -- -D warningscd java && ./mvnw spotless:check