voonhous opened a new pull request, #17581: URL: https://github.com/apache/hudi/pull/17581
### Describe the issue this Pull Request addresses **Reference issue:** https://github.com/apache/hudi/issues/14282 This PR focuses on migrating usages of `AvroSchemaUtils` to the internal `HoodieSchema` abstraction and `HoodieSchemaUtils`. **Key Changes:** 1. **Migration:** Migrated logic in key write/read paths (e.g., `HoodieTable`, `HoodieWriteHandle`, `HoodieRowParquetWriteSupport`) to use `HoodieSchema` and `HoodieSchemaCompatibility`. 2. **Full Qualification:** For classes where migration was not immediately feasible, calls to `AvroSchemaUtils` static functions have been **fully qualified**. This explicitly marks technical debt and makes these usages easily searchable for future refactoring. 3. **Utility Enhancements:** Added necessary bridge methods to `HoodieSchemaUtils` and `HoodieSchemaCompatibility` to support `HoodieSchema` objects directly. <details> <summary><strong>Classes NOT included in migration (Fully Qualified)</strong></summary> The following classes retain `AvroSchemaUtils` usage but are now fully qualified: 1. `TestAvroSchemaUtils` 2. `AvroSchemaUtils` (Self) 3. `AvroSchemaComparatorForRecordProjection` 4. `HoodieAvroUtils` 5. `HoodieSchemaCompatibility` 6. `MissingSchemaFieldException` 7. `HoodieSchemaUtils` 9. `SchemaBackwardsCompatibilityException` 9. `AvroSchemaRepair` 10. `TestAvroSchemaRepair` </details> <details> <summary><strong>Specific Ignored Usages (getAvroRecordQualifiedName)</strong></summary> The following classes ignore `AvroSchemaUtils.getAvroRecordQualifiedName`: - `BaseHoodieWriteClient` - `HoodieCatalog` - `HoodieHiveCatalog` - `HoodieTableFactory` - `StreamSync` - `TestHoodieTableFactory` </details> ### Summary and Changelog This PR is a refactoring effort to improve schema abstraction within Hudi. By moving away from raw Avro utils, we pave the way for better type safety and cleaner internal APIs. ### Impact * **Internal API Change:** Methods in `HoodieSchemaUtils` and `HoodieSchemaCompatibility` now play a larger role in schema validation and evolution logic. * **No User-Facing Change:** This is a code health and refactoring PR; there are no changes to public configs or external behaviors. ### Risk Level **Low** ### Documentation Update none ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] 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]
