Jackie-Jiang commented on code in PR #11859:
URL: https://github.com/apache/pinot/pull/11859#discussion_r1372361458


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -729,6 +729,24 @@ public List<String> getAllOfflineTables() {
     return offlineTableNames;
   }
 
+  /**
+   * Get all dimension table names.
+   *
+   * @return List of dimension table names
+   */
+  public List<String> getAllDimensionTables() {
+    List<String> dimensionTableNames = new ArrayList<>();
+    for (String resourceName : getAllResources()) {
+      if (TableNameBuilder.isOfflineTableResource(resourceName)) {
+        final TableConfig tableConfig = getTableConfig(resourceName);

Review Comment:
   This will read table config for all tables (potentially thousands) which can 
be very expensive. Are we sure we want to support this? A cheaper way would be 
to read it from `TableCache`



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java:
##########
@@ -268,20 +268,27 @@ public String recommendConfig(String inputStr) {
   @Path("/tables")
   @Authorize(targetType = TargetType.CLUSTER, action = 
Actions.Cluster.GET_TABLE)
   @ApiOperation(value = "Lists all tables in cluster", notes = "Lists all 
tables in cluster")
-  public String listTables(@ApiParam(value = "realtime|offline") 
@QueryParam("type") String tableTypeStr,
+  public String listTables(@ApiParam(value = "realtime|offline|dimension") 
@QueryParam("type") String tableTypeStr,
       @ApiParam(value = "Task type") @QueryParam("taskType") String taskType,
       @ApiParam(value = "name|creationTime|lastModifiedTime") 
@QueryParam("sortType") String sortTypeStr,
       @ApiParam(value = "true|false") @QueryParam("sortAsc") 
@DefaultValue("true") boolean sortAsc) {
     try {
+      final boolean isDimensionTable = 
StringUtils.equalsIgnoreCase(tableTypeStr, "dimension");

Review Comment:
   (minor)
   ```suggestion
        boolean isDimensionTable = "dimension".equalsIgnoreCase(tableTypeStr);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to