This is an automated email from the ASF dual-hosted git repository.

indhumuthumurugesh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new fdd00ab  [CARBONDATA-4213] Fix update/delete issue in index server
fdd00ab is described below

commit fdd00abb475a1932c07dbe797071533295d602fc
Author: Vikram Ahuja <[email protected]>
AuthorDate: Wed Jun 16 16:24:56 2021 +0530

    [CARBONDATA-4213] Fix update/delete issue in index server
    
    Why is this PR needed?
    During update/delete, the segment file in the segment would come as an empty
    string due to which it was not able to read the segment file.
    
    What changes were proposed in this PR?
    1. Changed the empty string to NULL
    2. Added empty segment file condition while creating SegmentFileStore.
    
    Does this PR introduce any user interface change?
    No
    
    Is any new testcase added?
    No
    
    This closes #4153
---
 .../main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java   | 2 +-
 .../carbondata/core/readcommitter/TableStatusReadCommittedScope.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java 
b/core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java
index c02af10..b814152 100644
--- a/core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java
@@ -580,7 +580,7 @@ public class CarbonUpdateUtil {
     for (Map.Entry<String, Long> eachSeg : segmentBlockCount.entrySet()) {
 
       if (eachSeg.getValue() == 0) {
-        segmentsToBeDeleted.add(new Segment(eachSeg.getKey(), ""));
+        segmentsToBeDeleted.add(new Segment(eachSeg.getKey(), (String) null));
       }
 
     }
diff --git 
a/core/src/main/java/org/apache/carbondata/core/readcommitter/TableStatusReadCommittedScope.java
 
b/core/src/main/java/org/apache/carbondata/core/readcommitter/TableStatusReadCommittedScope.java
index 2c9ab84..68dceeb 100644
--- 
a/core/src/main/java/org/apache/carbondata/core/readcommitter/TableStatusReadCommittedScope.java
+++ 
b/core/src/main/java/org/apache/carbondata/core/readcommitter/TableStatusReadCommittedScope.java
@@ -83,7 +83,7 @@ public class TableStatusReadCommittedScope implements 
ReadCommittedScope {
   public Map<String, String> getCommittedIndexFile(Segment segment) throws 
IOException {
     Map<String, String> indexFiles;
     SegmentFileStore fileStore = null;
-    if (segment.getSegmentFileName() != null) {
+    if (segment.getSegmentFileName() != null && 
!segment.getSegmentFileName().isEmpty()) {
       fileStore = new SegmentFileStore(identifier.getTablePath(), 
segment.getSegmentFileName());
     }
     if (segment.getSegmentFileName() == null || fileStore.getSegmentFile() == 
null) {

Reply via email to