yadavay-amzn opened a new pull request, #56935: URL: https://github.com/apache/spark/pull/56935
### What changes were proposed in this pull request? Extends XML schema inference (`XmlInferSchema`) to infer nanosecond-precision timestamp types. A timestamp string with more than 6 fractional-second digits (with timezone info) now infers as the nanosecond LTZ timestamp type, mirroring the existing nanosecond NTZ inference in the same file and the JSON/CSV nanosecond-inference approach. Behavior is gated on the existing nanosecond-timestamp config; values with <= 6 fractional digits still infer as the microsecond `TimestampType`. ### Why are the changes needed? Part of nanosecond-precision timestamp support (SPARK-56822). XML inference previously truncated sub-microsecond timestamps to microsecond precision; it should infer the nanosecond type when the data warrants it, consistent with JSON and CSV. ### Does this PR introduce _any_ user-facing change? Yes - with nanosecond timestamp types enabled, XML schema inference can infer a nanosecond-precision timestamp type for sub-microsecond timestamps (previously inferred as microsecond `TimestampType`). ### How was this patch tested? `XmlInferSchemaSuite`: new tests covering pure-nanosecond inference, pure-microsecond (unchanged), mixed widening, and string fallback. ### Was this patch authored or co-authored using generative AI tooling? Authored with assistance by Claude Opus 4.8. -- 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]
