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

    https://github.com/apache/carbondata/pull/2488#discussion_r202544216
  
    --- 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 --
    
    I think it is better to get the version from data file instead of index 
file which is an optional file


---

Reply via email to