cshuo opened a new pull request, #19359:
URL: https://github.com/apache/hudi/pull/19359

   ### Describe the issue this Pull Request addresses
   
   Closes #19358.
   
   The metadata table read path in `hudi-common` had substantial uncovered 
branch and error handling logic across metadata-backed and filesystem-backed 
reads.
   
   While adding focused coverage, the tests also exposed an argument-order bug 
in `MetadataPartitionType`: expression and secondary index lookups passed the 
source column and index type in reverse order to `getIndexDefinitions`. As a 
result, an existing matching index definition could be treated as missing.
   
   ### Summary and Changelog
   
   - Add focused unit tests for metadata table file listing, partition stats, 
column stats, record-index, secondary-index, rollback/restore, and reader error 
paths.
   - Cover empty, missing, unsupported-version, and fallback behavior in 
metadata-backed and filesystem-backed reads.
   - Add coverage for base-file record parsing and base metadata read helpers.
   - Fix expression-index and secondary-index definition lookups to pass the 
index type and source column in the expected order.
   
   Coverage targets from the issue:
   
   | Class | Before | Expected after |
   | --- | ---: | ---: |
   | `HoodieTableMetadataUtil` | 82% | >=92% |
   | `HoodieBackedTableMetadata` | 82% | >=92% |
   | `HoodieMetadataPayload` | 83% | >=92% |
   | `BaseTableMetadata` | 83% | >=92% |
   | `FileSystemBackedTableMetadata` | 85% | >=92% |
   | `MetadataPartitionType` | 83% | >=92% |
   | `BaseFileRecordParsingUtils` | 78% | >=92% |
   
   The exact post-change percentages will be verified by Codecov in CI.
   
   ### Impact
   
   No public API or configuration changes. The argument-order fix prevents 
redundant registration behavior when a matching expression or secondary index 
definition already exists.
   
   ### Risk level (write none, low medium or high below)
   
   Low. The production change is limited to correcting two lookup argument 
orders, with unit tests covering matching and non-matching index definitions. 
The remaining changes are test-only.
   
   ### Documentation Update
   
   None. This change does not alter user-facing APIs or configuration.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Change is not dependent on another unmerged change
   - [x] The public API and documentation are not affected
   - [x] Tests for the changes have been added
   
   ### Test plan
   
   Passed:
   
   ```shell
   mvn -pl hudi-common -am -Punit-tests \
     
-Dtest='TestBaseFileRecordParsingUtils,TestMetadataPartitionType,TestHoodieTableMetadataUtil,TestHoodieBackedTableMetadataDataCleanup'
 \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -DskipITs -DskipSparkTests -DskipScalaTests test
   
   mvn -pl hudi-hadoop-common -am -Punit-tests \
     
-Dtest='TestBaseTableMetadata,TestHoodieMetadataPayload,TestFileSystemBackedTableMetadata'
 \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -DskipITs -DskipSparkTests -DskipScalaTests test
   ```
   


-- 
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]

Reply via email to