danny0405 opened a new pull request, #20784: URL: https://github.com/apache/hudi/pull/20784
### Describe the issue this Pull Request addresses Closes #20371. Merged #20426 and #20492 cover DSv2 table creation, property reconciliation, metadata-column deletes and actionable rejection of unsupported column changes. The remaining gap is protection of persisted table identity through write-option aliases. For example, setting `hoodie.datasource.write.keygenerator.class` or `hoodie.datasource.write.partitionpath.field` currently changes catalog properties without validating the persisted table. Re-sending a stale catalog value also bypasses validation, while an unchanged key-generator class can be rejected when a newer table stores only its type. ### Summary and Changelog - Map the partition-field, key-generator-class and key-generator-type write options to their persisted table properties. - Resolve key-generator class/type representations from persisted configuration without supplying write defaults. Match Spark's case-insensitive key-generator type names while preserving exact class names, partition fields and custom generators. - Validate protected values against `hoodie.properties` even when the requested value matches the catalog. Keep an empty partition-field setting idempotent for an unpartitioned table. - Add COW/MOR catalog regressions on table versions 6 and 8 for repeated reconciliation, rejected changes/removals, stale catalog values, preservation of schema and properties, and subsequent reads/writes. Add unpartitioned and legacy/custom key-generator coverage. - No code was copied from another project. ### Impact The DSv2 catalog now rejects identity changes made through the missing aliases before applying other property or schema changes in the request. Valid unchanged settings remain no-ops, and ordinary mutable properties remain supported. Unchanged protected-property requests now read persisted configuration for validation, once per alter call. No storage-format or API signature changes, and no new configuration options. This does not add general DDL atomicity, additional schema-evolution operations, or NOT NULL enforcement. ### Risk Level low. The changes are limited to catalog property validation and alias resolution. Validation on JDK 17: - Before the fix, the five new catalog regressions failed on Spark 3.5; the existing 13 catalog tests passed. - Spark 3.5 / Scala 2.12: clean reactor package passed, with 18 `TestHoodieCatalogDDL` tests and 12 `TestHoodieOptionConfig` tests passing, no failures or skips. - Spark 4.1 / Scala 2.13: reactor package passed, with the same 18 catalog tests and 12 option-mapping tests passing, no failures or skips. - Checkstyle, Scalastyle, RAT, `git diff --check` and the repository PR-description validator passed. Remote CI is pending. ### Documentation Update none. This completes the existing catalog bug fix without adding a feature or configuration. Code comments explain the key-generator representations and the unpartitioned-table no-op. ### 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]
