kadirozde commented on code in PR #1701:
URL: https://github.com/apache/phoenix/pull/1701#discussion_r1375085983
##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java:
##########
@@ -1330,24 +1345,43 @@ public static List<Mutation>
prepareIndexMutationsForRebuild(IndexMaintainer ind
applyDeleteOnPut(deleteToApply, currentDataRowState);
Put nextDataRowState = currentDataRowState;
if (nextDataRowState.getFamilyCellMap().size() == 0) {
- Mutation del =
indexMaintainer.buildRowDeleteMutation(indexRowKeyForCurrentDataRow,
- IndexMaintainer.DeleteType.ALL_VERSIONS, ts);
- indexMutations.add(del);
+ if (indexRowKeyForCurrentDataRow != null) {
+ Mutation
+ del =
+
indexMaintainer.buildRowDeleteMutation(indexRowKeyForCurrentDataRow,
+
IndexMaintainer.DeleteType.ALL_VERSIONS, ts);
+ indexMutations.add(del);
+ }
currentDataRowState = null;
indexRowKeyForCurrentDataRow = null;
- } else {
+ } else if (indexRowKeyForCurrentDataRow != null) {
+ if
(!IndexRegionObserver.shouldPrepareIndexMutations(indexMaintainer,
+ nextDataRowState)) {
+ currentDataRowState = nextDataRowState;
+ Mutation del = indexMaintainer.buildRowDeleteMutation(
+ indexRowKeyForCurrentDataRow,
+ IndexMaintainer.DeleteType.ALL_VERSIONS, ts);
+ indexMutations.add(del);
+ indexRowKeyForCurrentDataRow = null;
+ continue;
+ }
ValueGetter nextDataRowVG = new
IndexUtil.SimpleValueGetter(nextDataRowState);
- Put indexPut = prepareIndexPutForRebuid(indexMaintainer,
rowKeyPtr, nextDataRowVG, ts);
+ Put indexPut = prepareIndexPutForRebuid(indexMaintainer,
rowKeyPtr,
Review Comment:
Done
--
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]