luoyuxia opened a new pull request, #3406:
URL: https://github.com/apache/fluss/pull/3406

   ### Purpose
   
   Linked issue: close #3405
   
   When `LakeSnapshotAndLogSplitScanner` starts with the log scan already 
finished, it can construct `SortMergeReader` before initializing the lake 
snapshot row comparator. With multiple lake snapshot iterators, this can pass a 
null comparator into the merge priority queue and fail with an NPE.
   
   This change makes the scanner initialize lake readers and the sorted lake 
comparator through the same path regardless of whether log scanning finishes 
before the first poll.
   
   ### Brief change log
   
   - Add a shared lake reader initialization method in 
`LakeSnapshotAndLogSplitScanner`.
   - Initialize `rowComparator` from `SortedRecordReader.order()` before 
constructing `SortMergeReader` in both log-finished and log-polling paths.
   - Guard lake reader initialization with an explicit boolean instead of 
relying on iterator list emptiness.
   
   ### Tests
   
   - `./mvnw -pl fluss-client spotless:apply`
   - Not run: unit/integration tests, per requester instruction.
   
   ### API and Format
   
   No public API, RPC, or storage format changes.
   
   ### Documentation
   
   No documentation changes. This is a bug fix.
   
   Generated-by: Codex following 
https://github.com/apache/fluss/blob/main/AGENTS.md
   


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