yihua opened a new pull request, #20254: URL: https://github.com/apache/hudi/pull/20254
### Describe the issue this Pull Request addresses closes #20253 Prepped Spark writes on the AVRO record type (Spark SQL `UPDATE`, pk-less `MERGE INTO`, datasource prepped upserts) rebuild the meta-field-free Avro schema for every record in `HoodieCreateRecordUtils.createHoodieRecordRdd`, and every field copy re-parses the Avro version string. The per-record call came in with the prepped UPDATE path (#8956), was widened by #9083 and #9261, and was rewritten in place by later schema migrations without being hoisted; `gteqAvro1_12` (#12772) copied the per-call version compare of the test-only helpers. ### Summary and Changelog The meta-field-free schema is built once per partition (as the SPARK record branch already does) and `gteqAvro1_9/1_10/1_12` return constants computed at class init. `TestHoodieCreateRecordUtils` asserts all records of a partition share one schema instance for each prepped flag (fails on master with 20 instances for 20 records). ### Impact Much less allocation and CPU for Spark SQL `UPDATE` and pk-less `MERGE INTO`. On a 6M-row, 30-column table an `UPDATE` touching 612k rows allocated 332 GB before this change, about two thirds of it in this schema construction; per record the conversion drops from about 21.6 KB to 3-4.5 KB allocated. No behavior change. ### Risk Level low ### Documentation Update none ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Enough context is provided in the sections above - [ ] Adequate tests were added if applicable -- 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]
