Skip to content
Browse files
[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?

Is any new testcase added?

This closes #4153
  • Loading branch information
vikramahuja1001 authored and Indhumathi27 committed Jun 18, 2021
1 parent 95ab745 commit fdd00abb475a1932c07dbe797071533295d602fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -580,7 +580,7 @@ public static List<Segment> getListOfSegmentsToMarkDeleted(Map<String, Long> seg
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));

@@ -83,7 +83,7 @@ public LoadMetadataDetails[] getSegmentList() throws IOException {
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) {

0 comments on commit fdd00ab

Please sign in to comment.