Github user mohammadshahidkhan commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1782#discussion_r161367075
--- Diff:
core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/SegmentIndexFileStore.java
---
@@ -185,4 +219,98 @@ private MergedBlockIndex
readMergeBlockIndex(ThriftReader thriftReader) throws I
public Map<String, byte[]> getCarbonIndexMap() {
return carbonIndexMap;
}
+
+ /**
+ * This method will read the index information from carbon index file
+ *
+ * @param indexFile
+ * @return
+ * @throws IOException
+ */
+ private void readIndexAndFillBlockletInfo(CarbonFile indexFile) throws
IOException {
+ // flag to take decision whether carbondata file footer reading is
required.
+ // If the index file does not contain the file footer then carbondata
file footer
+ // read is required else not required
+ boolean isCarbonDataFileFooterReadRequired = true;
+ List<BlockletInfo> blockletInfoList = null;
+ List<BlockIndex> blockIndexThrift =
+ new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
+ CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
+ try {
+ indexReader.openThriftReader(indexFile.getCanonicalPath());
+ // get the index header
+ org.apache.carbondata.format.IndexHeader indexHeader =
indexReader.readIndexHeader();
+ DataFileFooterConverter fileFooterConverter = new
DataFileFooterConverter();
+ String filePath = indexFile.getCanonicalPath();
+ String parentPath = filePath.substring(0,
filePath.lastIndexOf(File.separator));
--- End diff --
I think better to CarbonCommonConstants.FILE_SEPARATOR instead of
File.separator.
---