HyukjinKwon opened a new pull request, #58615: URL: https://github.com/apache/spark/pull/58615
### What changes were proposed in this pull request? `HiveClientImpl.toInputFormat` / `toOutputFormat` resolve the configured InputFormat / OutputFormat class names when converting a metastore table. This changes those two lookups to resolve the class without running its static initializer (`Utils.classForName(name, initialize = false)`); the class is initialized later, when it is actually instantiated for a scan or write, which is the only point it is needed. ### Why are the changes needed? The resolved `Class` is only used to obtain its name (`hiveTable.setInputFormatClass` stores `getName()`), so running the static initializer at metastore-conversion time is unnecessary work and can fail before the format is ever used. ### Does this PR introduce _any_ user-facing change? Yes. For an InputFormat / OutputFormat whose static initializer throws, the failure now surfaces when the format is instantiated at scan / write time rather than at DDL time (CREATE / ALTER TABLE). Tables that never read or write through such a format are unaffected, and behavior for valid formats is unchanged. ### How was this patch tested? Existing Hive client / DDL coverage. The resolved `Class` is only consumed by `hiveTable.setInputFormatClass`, which stores its name, so behavior for valid formats is unchanged; no new test meaningfully exercises the deferred-initialization path without a purpose-built format whose static initializer fails. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 This pull request and its description were written by Isaac. Co-authored-by: Isaac <[email protected]> -- 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]
