cshuo opened a new pull request, #19363: URL: https://github.com/apache/hudi/pull/19363
### Describe the issue this Pull Request addresses Closes #19362. Metadata-table writer paths in `hudi-client-common` and `hudi-spark-client` lacked functional coverage for real MDT-enabled writes. In particular, current and table-version-six writer behavior around metadata partitions, indexes, upsert, and rollback needed end-to-end validation beyond isolated mocks. ### Summary and Changelog #### Commit 1: test(hudi-client): improve metadata table writer coverage (`4459770`) - Adds `TestMetadataTableWithSparkSQL` with real COW/MDT writes covering column stats, partition stats, record index, secondary index, upsert, rollback, and table version 6. - Adds Spark writer and secondary-index utility tests for engine-specific and error paths. - Extends common writer/config tests for partition lifecycle, compaction, rollback, metrics propagation, and failure handling. - Adds concise comments to every new test case. | Class | Before | After | | --- | ---: | ---: | | `HoodieBackedTableMetadataWriter` | 83% | ≥90.17% | | `HoodieMetadataWriteUtils` | 83% | ≥94.42% | | `SparkHoodieBackedTableMetadataWriterTableVersionSix` | 46% | ≥91.67% | | `HoodieBackedTableMetadataWriterTableVersionSix` | 73% | ≥91.23% | | `SparkHoodieBackedTableMetadataWriter` | 83% | ≥94.83% | | `SecondaryIndexRecordGenerationUtils` | 88% | ≥91.16% | The after values are conservative local line-coverage union estimates; CI Codecov remains authoritative. Validation: - Common metadata writer and utility suites: 63 tests passed. - `TestSparkHoodieBackedTableMetadataWriter`: 6 tests passed. - `TestMetadataTableWithSparkSQL`: 2 functional tests passed with real MDT-enabled writes. - Checkstyle, RAT, and Scalastyle passed. ### Impact - Functional impact: none; this PR changes tests only. - Maintainability: guards current and table-version-six metadata writer lifecycle and index behavior. - Extensibility: adds reusable fixtures for validating future metadata write-path changes. ### Risk Level Low. The changes are test-only. The functional tests perform real Spark writes and therefore add some CI runtime; all targeted suites pass locally. ### Documentation Update None. ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute). - [x] Adequate tests were added. - [x] CI-relevant style checks pass locally. -- 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]
