Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix row ranges issue in Bigtable Read. #31990

Merged
merged 8 commits into from
Jul 31, 2024
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,18 @@ private ReadRowsRequest truncateRequest(ReadRowsRequest request, ByteString last
int startCmp = StartPoint.extract(rowRange).compareTo(new StartPoint(lastKey, true));
int endCmp = EndPoint.extract(rowRange).compareTo(new EndPoint(lastKey, true));

if (endCmp <= 0) {
// range end is on or left of the split: skip
continue;
}

RowRange.Builder newRange = rowRange.toBuilder();
if (startCmp > 0) {
// If the startKey is passed the split point than add the whole range
segment.addRowRanges(rowRange);
} else if (endCmp > 0) {
segment.addRowRanges(newRange.build());
} else {
// Row is split, remove all read rowKeys and split RowSet at last buffered Row
RowRange subRange = rowRange.toBuilder().setStartKeyOpen(lastKey).build();
segment.addRowRanges(subRange);
segment.addRowRanges(newRange.setStartKeyOpen(lastKey).build());
}
}
if (segment.getRowRangesCount() == 0) {
Expand Down
Loading