Skip to content

Commit 222a995

Browse files
dfa1claude
andcommitted
test(it): verify Java FSST write is readable by Rust JNI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b511339 commit 222a995

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import dev.vortex.jni.NativeLoader;
1111
import io.github.dfa1.vortex.core.DType;
1212
import io.github.dfa1.vortex.core.PType;
13+
import io.github.dfa1.vortex.encoding.FsstEncoding;
1314
import io.github.dfa1.vortex.encoding.VarBinEncoding;
1415
import io.github.dfa1.vortex.writer.VortexWriter;
1516
import io.github.dfa1.vortex.writer.WriteOptions;
@@ -351,6 +352,23 @@ void javaWriter_jniReader_utf8Column(@TempDir Path tmp) throws IOException {
351352
assertThat(decoded).containsExactly(data);
352353
}
353354

355+
@Test
356+
void javaWriter_jniReader_fsstUtf8Column(@TempDir Path tmp) throws IOException {
357+
// Given — FSST encoding: bigram symbol table, escape fallback for unmatched bytes
358+
Path file = tmp.resolve("java_fsst_utf8.vtx");
359+
String[] data = {"apple", "banana", "cherry", "apricot", "avocado", "almond"};
360+
try (var ch = FileChannel.open(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);
361+
var sut = VortexWriter.create(ch, STRING_SCHEMA, WriteOptions.defaults(),
362+
List.of(new FsstEncoding()))) {
363+
// When
364+
sut.writeChunk(Map.of("s", data));
365+
}
366+
367+
// Then
368+
String[] decoded = readStringColumn(file, "s");
369+
assertThat(decoded).containsExactly(data);
370+
}
371+
354372
@Test
355373
void javaWriter_jniReader_dictEncodedUtf8Column(@TempDir Path tmp) throws IOException {
356374
// Given — DictEncoding (DictLayoutMetadata proto + children[0]=codes, children[1]=VarBin values)

0 commit comments

Comments
 (0)