Todd Lipcon has submitted this change and it was merged.

Change subject: MergeIterator: don't stop iterating on an empty block

MergeIterator: don't stop iterating on an empty block

The MergeIterator implementation was incorrectly considering an input
iterator to be fully exhausted after it received any block which had no
selected rows. This could be triggered in a couple cases:

- if a predicate dropped more consecutive rows than the block size, then
  the entire iterator would be empty and any further rows from that
  iterator would be skipped.
- if enough consecutive rows were deleted such that an entire block
  needed to be skipped, the same behavior was triggered.

The new test changes the test iterator so that it doesn't yield its
entire input in a single block. Then, I added a new predicate which
triggered the first case above. I also had to add another assertion
which verifies that the result list was not incorrectly truncated.
Lastly, the test had incorrectly treated the predicate upper bound as an
inclusive bound, whereas in fact it has been exclusive for quite some

Change-Id: I07651ef4451609d8228b5e0f0de022970db4ebcf
Reviewed-by: Mike Percy <>
Tested-by: Kudu Jenkins
M src/kudu/common/
M src/kudu/common/
2 files changed, 61 insertions(+), 44 deletions(-)

  Mike Percy: Looks good to me, approved
  Kudu Jenkins: Verified

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: I07651ef4451609d8228b5e0f0de022970db4ebcf
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <>
Gerrit-Reviewer: Anonymous Coward #80
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <>
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to