iRakson opened a new pull request, #57119: URL: https://github.com/apache/spark/pull/57119
### What changes were proposed in this pull request? Extend `StatFunctions.multipleApproxQuantiles` to accept TimeType columns. TimeType columns are casted to DecimalType(14,9) before being casted to DoubleType to preserve nanosecond-of-day precision. `StatFunctions.multipleApproxQuantiles` returns `Seq[Seq[Double]]`, hence TimeType column's quantiles are returned as seconds since midnight. Extended `StatFunctions.summary` to accept TimeType columns. `avg` and `stddev` does not operate on TimeType columns and hence their output is `NULL`. ### Why are the changes needed? The DataFrame stat APIs do not handle TIME. StatFunctions.multipleApproxQuantiles requires NumericType and casts to DoubleType, and summary includes only numeric/string columns. SQL approx_percentile already supports TIME , but df.stat.approxQuantile / df.summary() / df.describe() do not route TIME there. ### Does this PR introduce _any_ user-facing change? Yes. `df.stat. approxQuantile` now accepts TimeType columns. df.summary() and df.describe() also accepts TimeType columns. ### How was this patch tested? UTs added. ### Was this patch authored or co-authored using generative AI tooling? No -- 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]
