Github user mohammadshahidkhan commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2429#discussion_r199685364
  
    --- Diff: 
hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java
 ---
    @@ -341,21 +343,32 @@ public CarbonTable 
getOrCreateCarbonTable(Configuration configuration) throws IO
           long minSize = Math.max(getFormatMinSplitSize(), 
getMinSplitSize(job));
           long maxSize = getMaxSplitSize(job);
           for (Segment segment : streamSegments) {
    -        String segmentDir = CarbonTablePath.getSegmentPath(
    -            identifier.getTablePath(), segment.getSegmentNo());
    +        String segmentDir =
    +            CarbonTablePath.getSegmentPath(identifier.getTablePath(), 
segment.getSegmentNo());
             FileFactory.FileType fileType = 
FileFactory.getFileType(segmentDir);
             if (FileFactory.isFileExist(segmentDir, fileType)) {
    -          String indexName = 
CarbonTablePath.getCarbonStreamIndexFileName();
    -          String indexPath = segmentDir + File.separator + indexName;
    -          CarbonFile index = FileFactory.getCarbonFile(indexPath, 
fileType);
    -          // index file exists
    -          if (index.exists()) {
    -            // data file exists
    -            CarbonIndexFileReader indexReader = new 
CarbonIndexFileReader();
    +          SegmentIndexFileStore segmentIndexFileStore = new 
SegmentIndexFileStore();
    +          segmentIndexFileStore.readAllIIndexOfSegment(segmentDir);
    +          Map<String, byte[]> carbonIndexMap = 
segmentIndexFileStore.getCarbonIndexMap();
    +          Set<Map.Entry<String, byte[]>> entries = 
carbonIndexMap.entrySet();
    +          CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
    +          for (Map.Entry<String, byte[]> entry : entries) {
    --- End diff --
    
    Fixed


---

Reply via email to