cloud-fan opened a new pull request, #56916: URL: https://github.com/apache/spark/pull/56916
### What changes were proposed in this pull request? This is a followup of [SPARK-57458](https://issues.apache.org/jira/browse/SPARK-57458). The nanosecond-precision timestamp inference in `XmlInferSchema.tryParseTimestampNTZ` used a `return` statement inside an `Option.foreach` closure, which is a non-local return implemented via a control-flow exception. This replaces it with a plain boolean check plus a local `return`, keeping the behavior identical while avoiding the non-local return. ### Why are the changes needed? Non-local returns rely on throwing/catching a `NonLocalReturnControl` exception, which is discouraged and flagged by lint tooling. The rewrite is equivalent and clearer. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Existing tests for nanosecond timestamp inference in the XML datasource cover this code path. ### Was this patch authored or co-authored using generative AI tooling? Yes, this patch was co-authored using generative AI tooling. -- 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]
