diff --git a/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java b/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java index 187f0e21..167778c2 100644 --- a/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java +++ b/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java @@ -72,10 +72,11 @@ void quitsOnEscapeWithoutRenderingDetails() throws Exception { } @Test - void deepExpand_rendersDictAndDataPanes_synchronously() throws Exception { - // Given — a rich fixture (low-cardinality dict column + an I64 column) and a - // script that expands the whole tree, then visits every row so each node's - // detail pane renders. worker == null runs all previews inline. + void deepExpand_rendersDictStatsAndDataPanes_synchronously() throws Exception { + // Given — a rich fixture (low-cardinality dict column + an I64 column, which the + // writer now wraps in a vortex.stats zone-map) and a script that expands the whole + // tree, then visits every row so each node's detail pane renders. worker == null + // runs all previews inline. Path file = TuiTestSupport.writeRichVortex(tmp, "rich.vortex", 200); FakeTerminal term = new FakeTerminal(new Terminal.Size(40, 120), expandAndVisitAll()); @@ -85,9 +86,10 @@ void deepExpand_rendersDictAndDataPanes_synchronously() throws Exception { VortexInspectorTui.run(term, tree, handle, null); } - // Then — the dictionary-preview and data-preview panes both rendered + // Then — the dictionary, per-chunk stats, and data preview panes all rendered String out = term.output(); assertThat(out).contains("Dictionary"); + assertThat(out).contains("Per-chunk stats"); assertThat(out).contains("Data (column"); } diff --git a/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java b/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java index 4a905776..0c140a5f 100644 --- a/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java +++ b/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java @@ -495,6 +495,37 @@ void javaWriter_jniReader_multipleChunks(@TempDir Path tmp) throws IOException { assertThat(decodedIds).containsExactly(1L, 2L, 3L, 4L, 5L); } + @Test + void javaWriter_jniReader_zoneMapped_multipleZones(@TempDir Path tmp) throws IOException { + // Given — a small chunkSize forces several chunks, so the writer emits a vortex.stats + // zone-map with one zone per chunk. The Rust reader must parse that layout and still + // return every value (zones are a transparent pruning aux). + Path file = tmp.resolve("java_zoned.vtx"); + WriteOptions zoneMapped = new WriteOptions(4, true, 0.90, 0, true, false); + long[] ids = new long[20]; + double[] vals = new double[20]; + for (int i = 0; i < 20; i++) { + ids[i] = i; + vals[i] = i * 0.5; + } + try (var ch = FileChannel.open(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE); + var sut = VortexWriter.create(ch, SCHEMA, zoneMapped)) { + for (int start = 0; start < 20; start += 4) { + sut.writeChunk(Map.of( + "id", Arrays.copyOfRange(ids, start, start + 4), + "value", Arrays.copyOfRange(vals, start, start + 4))); + } + } + + // When + long[] decodedIds = readLongColumn(file, "id"); + double[] decodedVals = readDoubleColumn(file, "value"); + + // Then — all rows survive the Java zone-map -> Rust read round-trip + assertThat(decodedIds).containsExactly(ids); + assertThat(decodedVals).containsExactly(vals); + } + @Test void javaWriter_jniReader_i32Column(@TempDir Path tmp) throws IOException { // Given