You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by chenliang613 <gi...@git.apache.org> on 2017/12/15 08:54:41 UTC
[GitHub] carbondata pull request #1660: [CARBONDATA-1731,CARBONDATA-1728] [BugFix] Up...
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 ?
---