voonhous opened a new issue, #19634:
URL: https://github.com/apache/hudi/issues/19634

   **Describe the problem**
   
   Three independent crashes in the `show_logfile_records` / 
`show_logfile_metadata` procedures:
   
   1. **Uncompacted MOR table + `merge => true`**: the merged scan resolves the 
latest instant via 
`getActiveTimeline.getCommitAndReplaceTimeline.lastInstant.get`; a 
deltacommit-only table has an empty commit timeline, so this throws 
`NoSuchElementException`. This is the procedure's primary use case (inspecting 
logs before compaction). The CLI twin was fixed in #13508 with 
`.map(HoodieInstant::requestedTime).orElse(currentInstantTime)`; the procedure 
never got the guard.
   2. **Non-data log blocks**: both procedures match `case dataBlock: 
HoodieDataBlock` with no default arm, so a delete block (v9 inline logs, or v10 
native `.deletes.*` files) or a rollback command block raises 
`scala.MatchError`. The CLI original has guarded with `instanceof` since 2020 
(#1687); the #5949 port dropped the guard.
   3. **`merge => true` with a key updated in more than one log block**: the 
merged record's data is a `SerializableIndexedRecord`, and the unconditional 
`asInstanceOf[HoodieRecordPayload[_]]` in `ShowHoodieLogFileRecordsProcedure` 
throws `ClassCastException`.
   
   **To reproduce**
   
   (1) MOR table, inserts + updates only, `show_logfile_records(..., merge => 
true)`. (2) `delete from <mor table>` then point the procedure at the delete 
block's log file. (3) update the same key twice, then `merge => true`. 
`TestHoodieLogFileProcedure` (since #19161) documents the workarounds it needs 
in comments referencing this issue.
   
   **Suggested fix**
   
   Port the CLI's `lastInstant` fallback, add a `case _ =>` skip arm to both 
matches, and handle `HoodieAvroIndexedRecord` / `SerializableIndexedRecord` 
data in the merged path.
   


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