Listing Tables with the MapR-DB JSON Java API Library
List the JSON tables that are in a folder by calling an Admin
object's
listTables()
method, passing as an argument the path of the
folder.
Use a conditional loop to iterate through the returned list and retrieve the names of the tables.
Example
public void listTables(String parentFolder) throws DBException {
try (Admin admin = MapRDB.newAdmin()) {
for(Path tablePath : admin.listTables(parentFolder)) {
System.out.println(tablePath);
}
}
}
Permission Required
The readAce
permission on the volumes where the JSON tables are located.
For information about how to set
permissions on volumes, see Setting/Modifying Whole Volume ACEs.