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

    https://github.com/apache/carbondata/pull/2982#discussion_r240229604
  
    --- Diff: 
integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableReader.java
 ---
    @@ -364,23 +355,38 @@ private CarbonTable 
parseCarbonMetadata(SchemaTableName table) {
           String tablePath = storePath + "/" + 
carbonTableIdentifier.getDatabaseName() + "/"
               + carbonTableIdentifier.getTableName();
     
    -      //Step 2: read the metadata (tableInfo) of the table.
    -      ThriftReader.TBaseCreator createTBase = new 
ThriftReader.TBaseCreator() {
    -        // TBase is used to read and write thrift objects.
    -        // TableInfo is a kind of TBase used to read and write table 
information.
    -        // TableInfo is generated by thrift,
    -        // see schema.thrift under format/src/main/thrift for details.
    -        public TBase create() {
    -          return new org.apache.carbondata.format.TableInfo();
    +      String metadataPath = CarbonTablePath.getSchemaFilePath(tablePath);
    +      boolean isTransactionalTable = false;
    +      try {
    +        if (FileFactory.getCarbonFile(metadataPath)
    --- End diff --
    
    The operator of getFileType is called twice in getCarbonFile and if(...), 
it's better to getting it ahead 
    FileType fileType = FileFactory.getFileType(metadataPath);
    if (FileFactory.getCarbonFile(metadataPath, 
fileType).isFileExist(metadataPath,fileType)) {...}


---

Reply via email to