Skip to content

Commit 0a88bb6

Browse files
dfa1claude
andcommitted
test(zstd): re-enable dictionary-compressed zstd.vortex interop (#104)
Dictionary-compressed vortex.zstd decode landed earlier via the native libzstd FFM bindings, but the Rust-vs-Java comparison still excluded the zstd.vortex fixture. Re-enable it and teach the test's string-column collector to unwrap a MaskedArray (nullable Utf8 now decodes as MaskedArray over a VarBin values child), so nullable_utf8 byte-length stats are compared too. The fixture now reads end-to-end and matches the Rust reference. Closes #104 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5efca29 commit 0a88bb6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Fixed
2121

22+
- `vortex.zstd` segments compressed with a shared (trained) dictionary now decode, via the native `libzstd` dictionary support, instead of being rejected. The upstream `zstd.vortex` compatibility fixture is read end-to-end and matches the Rust reference. ([#104](https://github.com/dfa1/vortex-java/issues/104))
2223
- Writing a nullable `Utf8`/`Binary` column no longer throws `NullPointerException` (or silently drops nulls): nullable string columns now carry their validity like nullable primitives and round-trip through `vortex.masked`. As a result they decode as `MaskedArray` (validity + values child) rather than a bare `VarBinArray`. ([#168](https://github.com/dfa1/vortex-java/pull/168))
2324
- CSV export now handles nullable columns (`MaskedArray`): null rows export as an empty field instead of failing with "unsupported array type for CSV export". ([#168](https://github.com/dfa1/vortex-java/pull/168))
2425
- Zone-map pruning now compares filter values in the *column's* type domain rather than by the boxed value's type. A predicate whose value is boxed at a different width (e.g. `Integer` on an `I64` column) — or any value on a `U64` column — previously pruned nothing and silently degraded to a full scan; it now prunes correctly (unsigned columns by unsigned order). As part of this, a filter value genuinely incomparable to its column (e.g. a `String` against a numeric column) now raises `VortexException` during the scan instead of silently disabling pruning — a behaviour change for callers that relied on the previous silent full scan. ([#159](https://github.com/dfa1/vortex-java/issues/159))

integration/src/test/java/io/github/dfa1/vortex/integration/RustJavaReaderComparisonIntegrationTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ private static Double numericSum(Array arr) {
356356
// ── Java side ─────────────────────────────────────────────────────────────
357357

358358
private static Long stringByteLength(Array arr) {
359-
if (!(arr instanceof VarBinArray v)) {
359+
// Nullable Utf8 columns decode as a MaskedArray over a VarBin values child (null rows
360+
// contribute zero-length entries); unwrap to count the same bytes Rust reports.
361+
Array values = arr instanceof MaskedArray m ? m.inner() : arr;
362+
if (!(values instanceof VarBinArray v)) {
360363
return null;
361364
}
362365
if (!(v.dtype() instanceof DType.Utf8)) {
@@ -394,7 +397,7 @@ private static Long stringByteLength(Array arr) {
394397
"varbin.vortex",
395398
"varbinview.vortex",
396399
"zigzag.vortex",
397-
// zstd.vortex excluded: ZstdEncoding dictionary mode not yet implemented
400+
"zstd.vortex",
398401
})
399402
void rust_vs_javaReader_statsMatch(String fixture, @TempDir Path tmp) throws Exception {
400403
// Given

0 commit comments

Comments
 (0)