Spenserrrr opened a new pull request, #59892: URL: https://github.com/apache/spark/pull/59892
### What changes were proposed in this pull request? - Centralize detailed-timing eligibility in `PythonUDFTimingGate` and share the plan's decision with SQL metric registration and Python runner configuration. - Extend timing to `mapInPandas`, including the initial UDF call and subsequent iterator execution, and count consumed input batches independently of output batches. - Measure input and output preparation around Arrow/pandas conversion and validation, and subtract nested input/read intervals to avoid counting the same work twice in sequential execution. - Reuse the shared Arrow read/write timers and preserve the timing-disabled path without handler clock reads. - Document the pipeline limitation: derived preparation durations can be negative in pipelined mode, so reports marked by `pythonNumPipelinedTasks` must be excluded from phase analysis until overlap attribution is supported. ### Why are the changes needed? `mapInPandas` needs phase-level timing to distinguish input preparation, user computation, and output preparation within Python worker processing time. ### Does this PR introduce _any_ user-facing change? Yes. Enabling `spark.sql.execution.pythonUDF.detailedTiming.enabled` adds phase durations and timing-coverage counts for `mapInPandas`; the setting remains disabled by default. ### How was this patch tested? Handler/serializer/collector tests and the isolated worker suite passed, along with Arrow/MapInPandas gate tests using existing local Spark classes; a fresh rebased `sql/compile` was blocked by unavailable `at.yawk.lz4:lz4-java:1.12.1`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6.1). -- 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]
