Github user ajantha-bhat commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2131#discussion_r178813379 --- Diff: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java --- @@ -83,28 +85,44 @@ public DataMapWriter createWriter(Segment segment, String writeDirectoryPath) { } @Override - public List<CoarseGrainDataMap> getDataMaps(Segment segment) throws IOException { + public List<CoarseGrainDataMap> getDataMaps(Segment segment, ReadCommitted readCommitted) + throws IOException { List<TableBlockIndexUniqueIdentifier> tableBlockIndexUniqueIdentifiers = - getTableBlockIndexUniqueIdentifiers(segment); + getTableBlockIndexUniqueIdentifiers(segment, readCommitted); return cache.getAll(tableBlockIndexUniqueIdentifiers); } - private List<TableBlockIndexUniqueIdentifier> getTableBlockIndexUniqueIdentifiers( - Segment segment) throws IOException { + private List<TableBlockIndexUniqueIdentifier> getTableBlockIndexUniqueIdentifiers(Segment segment, + ReadCommitted readCommitted) throws IOException { List<TableBlockIndexUniqueIdentifier> tableBlockIndexUniqueIdentifiers = segmentMap.get(segment.getSegmentNo()); if (tableBlockIndexUniqueIdentifiers == null) { tableBlockIndexUniqueIdentifiers = new ArrayList<>(); + Map<String, String> indexFiles; - if (segment.getSegmentFileName() == null) { - String path = - CarbonTablePath.getSegmentPath(identifier.getTablePath(), segment.getSegmentNo()); - indexFiles = new SegmentIndexFileStore().getIndexFilesFromSegment(path); + if (CarbonUtil.isUnmanagedCarbonTable(identifier.getTablePath(), true)) { --- End diff -- done
---