abstractdog opened a new issue, #3772:
URL: https://github.com/apache/parquet-java/issues/3772
### Describe the enhancement requested
### Problem
`ValuesReader.skip(int n)` ships with a naive default:
```java
public void skip(int n) {
for (int i = 0; i < n; i++) skip();
}
```
For dictionary-encoded columns (the common case), each `skip()` bottoms
out in `RunLengthBitPackingHybridDecoder.readInt()` — a mode switch,
array-index arithmetic, and a value the caller immediately discards.
Any filter-then-skip path (column-index row ranges, hash-join probe
filtering, runtime filters) pays this cost per skipped row.
### Measurement
`parquet-benchmarks / RleSkipBenchmark`, JMH throughput, JDK 17, single
fork, 100 k values/op:
| pattern | bitWidth | `readInt()` loop | `skipInts` | speedup |
|---------|---------:|-----------------:|-----------:|--------:|
| rle | 8 | 1.38 B/s | 104.9 B/s | ~76× |
| packed | 8 | 0.89 B/s | 4.12 B/s | ~4.6× |
| mixed | 8 | 0.96 B/s | 6.99 B/s | ~7.2× |
### Proposal
1. Add `RunLengthBitPackingHybridDecoder.skipInts(int n)` — re-use
`readNext()` per run, then advance `currentCount` by
`min(n, currentCount)` instead of walking every value through
`readInt()`.
2. Override `skip(int)` on `DictionaryValuesReader` and
`RunLengthBitPackingHybridValuesReader` to call `decoder.skipInts(n)`.
Base-class default stays. No API signatures change. Semantics identical
to N discarded `readInt()`s; verified by
`TestRunLengthBitPackingHybridDecoderSkip`.
### Component(s)
Core
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]