Skip to content

Commit 6d15ca1

Browse files
dfa1claude
andcommitted
docs(reader): correct zone-alignment claim and stale ZonedStatsSchema ref
columnZoneStats javadoc overstated alignment: zone-map rows align with chunkRowCounts() only on the fallback path and for files this writer produces (one zone per chunk). A foreign writer may use a fixed zone length independent of chunk boundaries, so the zone count need not match. Reword to scope the guarantee. Also fix VortexWriter's stale [io.github.dfa1.vortex.inspect] reference to ZonedStatsSchema — the class moved to the reader package in this branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3df5b7d commit 6d15ca1

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

reader/src/main/java/io/github/dfa1/vortex/reader/ScanIterator.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,15 @@ public long[] chunkRowCounts() {
402402
/// without touching any data segment. This is the source Rust populates for `SUM`, so the
403403
/// values match files written by either implementation. When no zone map is present the
404404
/// list falls back to each chunk's embedded `ArrayStats` (min/max/null count; `sum` is
405-
/// `null`, since the flat writer does not retain it). Either way the result has one entry
406-
/// per chunk/zone, positionally aligned with [#chunkRowCounts()]; a column that is absent
405+
/// `null`, since the flat writer does not retain it). Either way a column that is absent
407406
/// or carries no stats yields [ArrayStats#empty()] per zone.
408407
///
408+
/// Zone granularity is the layout's, not the scan's. The fallback path is one entry per
409+
/// chunk, positionally aligned with [#chunkRowCounts()]. The zone-map path is one entry per
410+
/// zone of the stats table: this writer emits one zone per chunk (so the same alignment
411+
/// holds), but a file from another writer may use a fixed zone length independent of chunk
412+
/// boundaries, in which case the zone count need not match [#chunkRowCounts()].
413+
///
409414
/// This is the read-side surface for aggregate push-down (ADR 0013 §6): a reduction can
410415
/// fold whole zones from these rows and fall back to a streaming decode only for the
411416
/// boundary zones a predicate partially selects.

writer/src/main/java/io/github/dfa1/vortex/writer/VortexWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ private int wrapZoneMap(FbsBuilder fbb, String colName, int dataLayout, long col
821821

822822
/// `vortex.stats` metadata: `u32` zone length (LE) + a 1-byte stat bitset (LSB-first) with the
823823
/// NULL_COUNT bit always set and the MAX/MIN and SUM bits set when present, matching
824-
/// [io.github.dfa1.vortex.inspect] `ZonedStatsSchema`.
824+
/// [io.github.dfa1.vortex.reader] `ZonedStatsSchema`.
825825
private static byte[] zonedMetadataBytes(long zoneLen, boolean hasMinMax, boolean hasSum) {
826826
byte[] meta = new byte[5];
827827
ByteBuffer.wrap(meta).order(ByteOrder.LITTLE_ENDIAN).putInt((int) zoneLen);

0 commit comments

Comments
 (0)