ShivanshhhG opened a new pull request, #19296: URL: https://github.com/apache/iceberg/pull/19296
Fixes #19294. ### Problem `BaseReader.next()` called `System.nanoTime()` at the start and in `finally` on every call. While that is negligible for `BaseBatchReader` (one call per batch), `BaseRowReader` invokes `next()` once per row, adding two clock reads per row on the non-vectorized read path. ### Solution - Add `protected boolean trackPerCallScanDuration()` (default `true`) to `BaseReader` in Spark 4.1 and 4.2, and override it to `false` in `BaseRowReader`. - When `trackPerCallScanDuration()` is `true`, `BaseBatchReader` keeps per-call timing in `next()`. - When `trackPerCallScanDuration()` is `false`, `next()` returns immediately from `currentIterator.next()` with zero `System.nanoTime()` calls on the per-row hot path, and `advanceTask()` / `close()` record elapsed wall time at task boundaries (including `open(currentTask)`, early `close()`, and error paths). - Add `TestBaseReader#testTaskBoundaryScanDuration` covering multi-task iteration, early close, and empty task groups. -- 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]
