|
10 | 10 | import dev.vortex.jni.NativeLoader; |
11 | 11 | import io.github.dfa1.vortex.core.DType; |
12 | 12 | import io.github.dfa1.vortex.core.PType; |
| 13 | +import io.github.dfa1.vortex.encoding.FsstEncoding; |
13 | 14 | import io.github.dfa1.vortex.encoding.VarBinEncoding; |
14 | 15 | import io.github.dfa1.vortex.writer.VortexWriter; |
15 | 16 | import io.github.dfa1.vortex.writer.WriteOptions; |
@@ -351,6 +352,23 @@ void javaWriter_jniReader_utf8Column(@TempDir Path tmp) throws IOException { |
351 | 352 | assertThat(decoded).containsExactly(data); |
352 | 353 | } |
353 | 354 |
|
| 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 | + |
354 | 372 | @Test |
355 | 373 | void javaWriter_jniReader_dictEncodedUtf8Column(@TempDir Path tmp) throws IOException { |
356 | 374 | // Given — DictEncoding (DictLayoutMetadata proto + children[0]=codes, children[1]=VarBin values) |
|
0 commit comments