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

   ### Describe the issue this Pull Request addresses
   
   `export_instants(..., desc => true)` throws `UnsupportedOperationException` 
on every invocation. `ExportInstantsProcedure` builds its instant and 
file-status lists via `asJava` over immutable Scala collections, producing 
read-only `java.util.List`s. The `desc` branch then reverses them in place with 
`Collections.reverse`, which calls `List.set` and fails on a read-only list. So 
descending export has never worked.
   
   ### Summary and Changelog
   
   - Wrap both `nonArchivedInstants` and `archivedStatuses` in a mutable `new 
java.util.ArrayList(...)` so `Collections.reverse` succeeds. Ascending export 
is unaffected.
   - Add `TestExportInstantsProcedure` coverage: ascending export, the 
descending-order regression case (which fails without this fix), action 
filtering, and the invalid-local-folder error path.
   
   ### Impact
   
   Fixes `export_instants` with `desc => true`. No change to ascending behavior 
or other procedures.
   
   ### Risk Level
   
   low. One-line-per-list change from an immutable wrapper to a mutable copy; 
the descending regression test exercises the previously-broken path.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [ ] 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