Github user chenliang613 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1660#discussion_r157148988
--- Diff:
core/src/main/java/org/apache/carbondata/core/mutate/DeleteDeltaBlockDetails.java
---
@@ -82,9 +80,21 @@ public boolean
addBlockletDetails(DeleteDeltaBlockletDetails blocklet) {
public boolean addBlocklet(String blockletId, String offset, Integer
pageId) throws Exception {
DeleteDeltaBlockletDetails blocklet = new
DeleteDeltaBlockletDetails(blockletId, pageId);
+ int index = blockletDetails.indexOf(blocklet);
+
try {
- blocklet.addDeletedRow(CarbonUpdateUtil.getIntegerValue(offset));
- return addBlockletDetails(blocklet);
+ boolean isRowAddedForDeletion =
+ blocklet.addDeletedRow(CarbonUpdateUtil.getIntegerValue(offset));
+ if (isRowAddedForDeletion) {
+ if (blockletDetails.isEmpty() || index == -1) {
+ return blockletDetails.add(blocklet);
+ } else {
+
blockletDetails.get(index).addDeletedRows(blocklet.getDeletedRows());
+ return true;
--- End diff --
why here should add "return true" again ?
blockletDetails.get(index).addDeletedRows(blocklet.getDeletedRows()) should
already return true ?
---