steFaiz opened a new pull request, #6738:
URL: https://github.com/apache/paimon/pull/6738

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... 
-->
   
   ### Purpose
   #### Problem
   Currently, the `BlockIterator` can't deal with 'seek + scan' scenario 
correctly. The bug can be illustrated below, assume that we are seeking to 25:
   When the `MID` pointer pointing at the block exactly smaller than 25, it 
works normally: 
   ```
   values:   ... 10, 20, 30, 40, 50 ...
                      |    
                      V    
                     MID 
              
   At that case, the final pointers' positions are:
   
                          Iter Pos
                       Polled ∆
                          ∆   |
                          |   | 
   values:   ... 10, 20, 30, 40, 50 ...
                      |   |
                      V   V
                    HIGH MID
                         LOW
   ```
   However, when the `MID` pointer pointing at the block exactly greater than 
25, some problems will happen:
   ```
   values:    10, 20, 30, 40, 50
                       |   
                       V   
                      MID 
              
   At that case, the final pointers' positions are:
   
                    Iter Pos
                     Polled 
                       ∆   
                       |   
   values:    10, 20, 30, 40, 50
                   |   |
                   V   V
                  MID LOW
                 HIGH
   ```
   The `Polled` pointer and the underlying `MemorySliceInput`'s pointer are 
pointing at the same place, which means the next calling of `next()` method 
won't move iterator position forward.
   
   <!-- Linking this pull request to the issue -->
   This PR is a part of https://github.com/apache/paimon/issues/6734
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   Please see org.apache.paimon.lookup.sort.BlockIteratorTest
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   None
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   None
   <!-- Does this change introduce a new feature -->
   


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