yashrsharma44 commented on a change in pull request #7142: URL: https://github.com/apache/incubator-pinot/pull/7142#discussion_r666678584
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java ########## @@ -210,15 +213,31 @@ public String listTableConfigs(@ApiParam(value = "realtime|offline") @QueryParam if (tableType == null) { tableNames = _pinotHelixResourceManager.getAllRawTables(); + } else if (tableType == TableType.REALTIME) { + tableNames = _pinotHelixResourceManager.getAllRealtimeTables(); } else { - if (tableType == TableType.REALTIME) { - tableNames = _pinotHelixResourceManager.getAllRealtimeTables(); - } else { - tableNames = _pinotHelixResourceManager.getAllOfflineTables(); - } + tableNames = _pinotHelixResourceManager.getAllOfflineTables(); } - Collections.sort(tableNames); + if (sortType == "name") { + // Sort table names alphabetically + Collections.sort(tableNames, sortAsc ? null : Collections.reverseOrder()); + } else { + // Sort table names based on (1) Create Time + TableType finalTableType = tableType; + Collections.sort(tableNames, (Comparator<String>) (o1, o2) -> { + TableStats s1, s2; + s1 = _pinotHelixResourceManager.getTableStats(o1); Review comment: I am using a hashmap, does it make sense? -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org