/* * * @ brief This function is used to get the disk space occupied by the DFS table * @ param * database is the absolute path of the folder where the database is stored * tableName is the name of dfs table * byNode is a Boolean value, indicating whether the disk usage is displayed by node * @ Return a table containing the disk space occupied by the DFS table * @ sample usage getTableDiskUsage("dfs://demodb", "machines", true) */ def getTableDiskUsage(database, tableName, byNode=false){ if(byNode == true){ return select sum(diskUsage\1024\1024\1024) diskGB from pnodeRun(getTabletsMeta{"/"+substr(database, 6)+"/%", tableName, true, -1}) group by node }else { return select sum(diskUsage\1024\1024\1024) diskGB from pnodeRun(getTabletsMeta{"/"+substr(database, 6)+"/%", tableName, true, -1}) } }