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

   ### Describe the issue this Pull Request addresses
   
   Fixes potential NPE in `LegacyArchivedMetaEntryReader` when reading older 
archived log files that don't have the `actionState` field set. This is the 
same issue addressed by HUDI-2190.
   
   The `ArchivedTimelineV1.java` already handles this case correctly, but 
`LegacyArchivedMetaEntryReader.java` (used during 7→8 upgrades via 
`SevenToEightUpgradeHandler`) does not have this fix.
   
   ### Summary and Changelog
   
   When reading archived timeline records, older log files may have 
`actionState` set to null. The current code calls 
`record.get(ACTION_STATE).toString()` which throws an NPE when actionState is 
null.
   
   **Changes:**
   - Added null check for `actionState` field in 
`LegacyArchivedMetaEntryReader.readInstant()`
   - Default to `HoodieInstant.State.COMPLETED` when actionState is null, 
consistent with the fix in `ArchivedTimelineV1.java`
   
   ### Impact
   
   No public API changes. This is a defensive fix to prevent NPE during upgrade 
scenarios when reading legacy archived timeline records.
   
   ### Risk Level
   
   low - This is a simple null check that defaults to the same behavior as the 
existing fix in ArchivedTimelineV1.java. The change only affects upgrade 
scenarios where old archived logs are being read.
   
   ### 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]

Reply via email to