dragonknightk opened a new pull request, #12180: URL: https://github.com/apache/arrow-rs/pull/12180
# Which issue does this PR close? - Closes #8307 # Rationale for this change Callers use `records_read_from_cache` to see how many rows the predicate cache served, including when the cache is disabled. The metric used to count every hit of a reader's temporary local buffer. `fetch_batch` always stores the decoded batch there, so later reads of the rest of that batch were reported as cache reads even when the shared cache was disabled. # What changes are included in this PR? `CachedArrayReader::read_records` now increments `records_read_from_cache` only for batches loaded from the shared (global) predicate cache. Later local hits of those batches still count. | Row source | Metric updated | | --- | --- | | Shared cache, including later local hits of those batches | `records_read_from_cache` | | `fetch_batch` decode into the local buffer | `records_read_from_inner` only | # Are these changes tested? `test_local_cache_hits_do_not_count_as_cache_reads` checks that a disabled shared cache reports zero cache reads for later local hits. `test_shared_cache_hits_count_across_partial_reads` checks that shared-cache rows still count when later served from `local_cache`. # Are there any significant user-facing changes? No public API changes; only the cache-read metric values are corrected. ## AI Disclosure Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change. All submitted content was reviewed by a human before submission. Grok Bot assisted with drafting the metric-accounting change, the regression tests, and this description. (๑•̀ㅂ•́)و✧ -- 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]
