Skip to content

Commit 2131719

Browse files
dfa1claude
andcommitted
refactor(test): normalize to "rust" naming, drop "jni" prefix
Rename VortexHttpReaderJniComparisonIntegrationTest → RustJavaReaderComparisonIntegrationTest; rename test method jni_vs_javaReader_statsMatch → rust_vs_javaReader_statsMatch. All internal comments updated accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 47a2c0c commit 2131719

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
- **`fastlanes.rle`** — RLE encoding
6161
Pattern: `VortexWriter.create(ch, SCHEMA, WriteOptions.defaults(), List.of(new XxxEncoding()))`
6262
then `readStringColumn` / `readLongColumn` via JNI. Run with `./mvnw verify -pl integration -am`.
63-
- [ ] **Normalize test naming conventions** — mixed: some say "jni" (`jni_vs_javaReader_*`, `VortexHttpReaderJniComparisonIntegrationTest`), others say "rust" (`RustWritesJavaReadsIntegrationTest`, `JavaWritesRustReadsIntegrationTest`). Pick one term and apply consistently across all test class/method names.
6463
- [ ] lots of repetitions like in every test
6564
```java
6665
private static final DType I64 = new DType.Primitive(PType.I64, false);

integration/src/test/java/io/github/dfa1/vortex/integration/VortexHttpReaderJniComparisonIntegrationTest.java renamed to integration/src/test/java/io/github/dfa1/vortex/integration/RustJavaReaderComparisonIntegrationTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
import static org.assertj.core.data.Percentage.withPercentage;
4747

4848
/// Cross-decoder correctness: downloads each S3 fixture once, then compares row counts,
49-
/// numeric column sums, and string byte-length sums from the Rust JNI reader and the
49+
/// numeric column sums, and string byte-length sums from the Rust reader and the
5050
/// Java {@link VortexReader}.
5151
///
5252
/// Both readers decode the same local bytes — no auth, no network dependency during
5353
/// decode. A mismatch in any column value points to a decoding bug in the Java reader.
54-
class VortexHttpReaderJniComparisonIntegrationTest {
54+
class RustJavaReaderComparisonIntegrationTest {
5555

5656
private static final URI BASE =
5757
URI.create("https://vortex-compat-fixtures.s3.amazonaws.com/v0.72.0/arrays/");
@@ -95,37 +95,37 @@ private record Stats(long rowCount, Map<String, Double> numSums, Map<String, Lon
9595
"zigzag.vortex",
9696
// zstd.vortex excluded: ZstdEncoding dictionary mode not yet implemented
9797
})
98-
void jni_vs_javaReader_statsMatch(String fixture, @TempDir Path tmp) throws Exception {
98+
void rust_vs_javaReader_statsMatch(String fixture, @TempDir Path tmp) throws Exception {
9999
// Given
100100
Path local = download(BASE.resolve(fixture), tmp);
101101

102102
// When
103-
Stats jniStats = jniStats(local);
103+
Stats rustStats = rustStats(local);
104104
Stats javaStats = javaStats(local);
105105

106106
// Then — row counts match
107107
assertThat(javaStats.rowCount())
108108
.as("row count in %s", fixture)
109-
.isEqualTo(jniStats.rowCount());
109+
.isEqualTo(rustStats.rowCount());
110110

111-
// Then — numeric column sums match (skip if no numeric cols in JNI output)
112-
if (!jniStats.numSums().isEmpty()) {
111+
// Then — numeric column sums match (skip if no numeric cols in Rust output)
112+
if (!rustStats.numSums().isEmpty()) {
113113
assertThat(javaStats.numSums().keySet())
114114
.as("numeric column names in %s", fixture)
115-
.containsExactlyInAnyOrderElementsOf(jniStats.numSums().keySet());
116-
for (Map.Entry<String, Double> entry : jniStats.numSums().entrySet()) {
115+
.containsExactlyInAnyOrderElementsOf(rustStats.numSums().keySet());
116+
for (Map.Entry<String, Double> entry : rustStats.numSums().entrySet()) {
117117
assertThat(javaStats.numSums().get(entry.getKey()))
118118
.describedAs("numeric column '%s' sum in %s", entry.getKey(), fixture)
119119
.isCloseTo(entry.getValue(), withPercentage(0.001));
120120
}
121121
}
122122

123-
// Then — string byte-length sums match for cols JNI tracks (JNI may miss LargeVarChar etc.)
124-
if (!jniStats.strLenSums().isEmpty()) {
123+
// Then — string byte-length sums match for cols Rust tracks (Rust may miss LargeVarChar etc.)
124+
if (!rustStats.strLenSums().isEmpty()) {
125125
assertThat(javaStats.strLenSums().keySet())
126126
.as("string column names in %s", fixture)
127-
.containsAll(jniStats.strLenSums().keySet());
128-
for (Map.Entry<String, Long> entry : jniStats.strLenSums().entrySet()) {
127+
.containsAll(rustStats.strLenSums().keySet());
128+
for (Map.Entry<String, Long> entry : rustStats.strLenSums().entrySet()) {
129129
assertThat(javaStats.strLenSums().get(entry.getKey()))
130130
.describedAs("string column '%s' byte-length sum in %s", entry.getKey(), fixture)
131131
.isEqualTo(entry.getValue());
@@ -145,9 +145,9 @@ private static Path download(URI uri, Path dir) throws Exception {
145145
return file;
146146
}
147147

148-
// ── JNI (Rust) side ───────────────────────────────────────────────────────
148+
// ── Rust side ────────────────────────────────────────────────────────────
149149

150-
private static Stats jniStats(Path file) throws Exception {
150+
private static Stats rustStats(Path file) throws Exception {
151151
Map<String, Double> numSums = new LinkedHashMap<>();
152152
Map<String, Long> strLenSums = new LinkedHashMap<>();
153153
long rowCount = 0;
@@ -351,7 +351,7 @@ private static Long stringByteLength(Array arr) {
351351
return null;
352352
}
353353
if (!(v.dtype() instanceof DType.Utf8)) {
354-
return null; // JNI only reports VarChar (UTF-8), skip Binary columns
354+
return null; // Rust only reports VarChar (UTF-8), skip Binary columns
355355
}
356356
long[] total = {0L};
357357
v.forEachByteLength(len -> total[0] += len);

0 commit comments

Comments
 (0)