Github user ajantha-bhat commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2982#discussion_r241286067 --- 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 { + FileFactory.FileType fileType = FileFactory.getFileType(metadataPath); + if (FileFactory.getCarbonFile(metadataPath, fileType).isFileExist(metadataPath, fileType)) { --- End diff -- currently, this reduces one function call, If I don't pass file type implicitly again they call this method. Let it be there now. when we remove filetype from file factory in the future, this also will be optimized.
---