added a parquet api

This commit is contained in:
Michele Artini 2021-02-19 15:52:14 +01:00
parent 43e0386b78
commit e5f7b88ea5
1 changed files with 8 additions and 0 deletions

View File

@ -215,6 +215,14 @@ public class MDStoreController extends AbstractDnetController {
return hdfsClient.readParquetFiles(path + "/store", limit);
}
@ApiOperation("read the parquet file of a mdstore (current version)")
@GetMapping("/mdstore/{mdId}/parquet/content/{limit}")
public List<Map<String, Object>> listMdstoreParquet(@PathVariable final String mdId, @PathVariable final long limit) throws MDStoreManagerException {
final String versionId = databaseUtils.findMdStore(mdId).getCurrentVersion();
final String path = databaseUtils.findVersion(versionId).getHdfsPath();
return hdfsClient.readParquetFiles(path + "/store", limit);
}
protected void setDatabaseUtils(final DatabaseUtils databaseUtils) {
this.databaseUtils = databaseUtils;
}