bmaidics commented on a change in pull request #1330: URL: https://github.com/apache/hive/pull/1330#discussion_r467011860
########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ########## @@ -5685,6 +5706,67 @@ private void alter_table_core(String catName, String dbname, String name, Table } } + @Override + public GetFileListResponse get_file_list(GetFileListRequest req) throws MetaException { + String catName = req.isSetCatName() ? req.getCatName() : getDefaultCatalog(conf); + String dbName = req.getDbName(); + String tblName = req.getTableName(); + List<String> partitions = req.getPartVals(); + // Will be used later, when cache is introduced + String validWriteIdList = req.getValidWriteIdList(); + + startFunction("get_file_list", ": " + TableName.getQualified(catName, dbName, tblName) + + ", partitions: " + partitions.toString()); + + + GetFileListResponse response = new GetFileListResponse(); + + boolean success = false; + Exception ex = null; + try { + Partition p = getMS().getPartition(catName, dbName, tblName, partitions); + Path path = new Path(p.getSd().getLocation()); + + FileSystem fs = path.getFileSystem(conf); + RemoteIterator<LocatedFileStatus> itr = fs.listFiles(path, true); + while (itr.hasNext()) { + FileStatus fStatus = itr.next(); + Reader reader = OrcFile.createReader(fStatus.getPath(), OrcFile.readerOptions(fs.getConf())); + boolean isRawFormat = !CollectionUtils.isEqualCollection(reader.getSchema().getFieldNames(), ALL_ACID_ROW_NAMES); + int fileFormat = isRawFormat ? 0 : 2; Review comment: My first thought was that is should be a boolean. But after some discussion, if we want to add new versions, or fileFormats (like we release ACID v3), it'd make sense not to store it in boolean in the first place. But you're right, for more readable code, we can use enums. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org