Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2601#discussion_r207223659
--- Diff:
core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
@@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion
getFormatVersion(CarbonTable carbonTable)
}
storePath =
carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
}
-
- CarbonFile[] carbonFiles = FileFactory
- .getCarbonFile(storePath)
- .listFiles(new CarbonFileFilter() {
- @Override
- public boolean accept(CarbonFile file) {
- if (file == null) {
- return false;
- }
- return file.getName().endsWith("carbondata");
- }
- });
- if (carbonFiles == null || carbonFiles.length < 1) {
- return CarbonProperties.getInstance().getFormatVersion();
+ // get the carbon index file header
+ FileFactory.FileType fileType = FileFactory.getFileType(storePath);
+ ColumnarFormatVersion version = null;
+ if (FileFactory.isFileExist(storePath, fileType)) {
--- End diff --
Rename storePath to segmentPath
---