adarshomrey opened a new pull request, #19297:
URL: https://github.com/apache/iceberg/pull/19297

   This overlaps with #19296; opening for comparison in case it is useful.
   
   Fixes #19294
   
   BaseReader.next() read System.nanoTime() twice per call. On the row read
   path next() runs once per row, so this added about two clock reads per row
   (~37 ns/row, +58% on a narrow SELECT sum(id) with vectorization off,
   as measured in #19022).
   
   This change keeps per-call timing for readers that return a batch per call
   and makes row readers time each task as one window instead: the timer starts
   when a task is opened and stops when the next task starts, the reader runs
   out of tasks, or the reader is closed. That is two clock reads per file
   instead of two per row.
   
   Trade-off: on the row path the metric covers the task's wall time, including
   time Spark spends between next() calls, rather than only time inside the
   reader. A metric read while a task is still in flight does not include that
   task yet.
   
   scanDuration has not shipped yet (not in 1.12.0), so this can land before 
1.13.
   
   Tests: added scanDurationForNonVectorizedReadOfSeveralFiles to
   TestSparkReadMetrics for 4.1 and 4.2. Ran TestSparkReadMetrics on both.


-- 
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]

Reply via email to