yangzhg commented on a change in pull request #4778:
URL: https://github.com/apache/incubator-doris/pull/4778#discussion_r511700554



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
##########
@@ -248,7 +248,19 @@ public TListTableStatusResult 
listTableStatus(TGetTablesParams params) throws TE
         if (db != null) {
             db.readLock();
             try {
-                for (Table table : db.getTables()) {
+                List<Table> tables = null;
+                if (!params.isSetType() || params.getType() == null || 
params.getType().isEmpty()) {
+                    tables = db.getTables();
+                } else {
+                    switch (params.getType()) {
+                        case "VIEW":
+                            tables = db.getViews();
+                            break;
+                        default:
+                            tables = db.getTables();
+                    }
+                }

Review comment:
       ```suggestion
                  List<Table> tables = db.getTables();
                   if (params.isSetType() && "VIEW".equals(params.getType())) {
                       tables = db. getViews();
                   }
   ```




----------------------------------------------------------------
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.

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