Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2488#discussion_r202544231
--- Diff:
core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
@@ -3231,4 +3231,42 @@ private static int
unsetLocalDictForComplexColumns(List<ColumnSchema> allColumns
}
return columnLocalDictGenMap;
}
+
+ /**
+ * This method get the carbon file format version
+ *
+ * @param carbonTable
+ * carbon Table
+ */
+ public static ColumnarFormatVersion getFormatVersion(CarbonTable
carbonTable) throws IOException
+ {
+ String tablePath = carbonTable.getTablePath();
+ CarbonFile[] carbonFiles = FileFactory
+ .getCarbonFile(tablePath)
+ .listFiles(new CarbonFileFilter() {
+ @Override
+ public boolean accept(CarbonFile file) {
+ if (file == null) {
+ return false;
+ }
+ return file.getName().endsWith("carbonindex");
--- End diff --
@ravipesala Is there any utility func to get the version from file footer
already?
---