hudi-agent commented on code in PR #18836: URL: https://github.com/apache/hudi/pull/18836#discussion_r3297733236
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java: ########## Review Comment: 🤖 **Line 973:** Since `resolveDataSchemaForRLIBootstrap` is called inside the `.flatMap(...)` lambda (line 968), it runs once per file slice on each Spark worker. In the fallback path this means constructing a fresh `TableSchemaResolver` and re-reading commit metadata from storage for every file slice. Could the schema be resolved once before `parallelize(...)` and captured as a closure variable instead? `HoodieSchema` is `Serializable` and the resolved schema doesn't vary per slice, so the bootstrap could avoid N storage reads for tables with many file slices. <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag quality.</i></sub> -- 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]
