tengqm commented on code in PR #6573:
URL: https://github.com/apache/gravitino/pull/6573#discussion_r1976537689


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/CatalogAudit.java:
##########
@@ -53,12 +53,20 @@ public void handle() {
       result = client.loadCatalog(this.catalog);
     } catch (NoSuchMetalakeException err) {
       exitWithError(ErrorMessages.UNKNOWN_METALAKE);
+      return; // Stop execution after handling error

Review Comment:
   Well ... it is kind of dead code, because this line will never be reached.
   However, adding a `return` here does make it more evident?
   WDYT, @justinmclean ?



##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListColumns.java:
##########
@@ -59,10 +59,42 @@ public void handle() {
     } catch (NoSuchTableException noSuchTableException) {
       exitWithError(
           ErrorMessages.UNKNOWN_TABLE + Joiner.on(".").join(metalake, catalog, 
schema, table));
+      return;
     } catch (Exception exp) {
       exitWithError(exp.getMessage());
+      return;
     }
 
-    printResults(columns);
+    // Null / empty check before processing columns
+    if (columns == null || columns.length == 0) {
+      exitWithError("No columns found for table: " + table);
+      return;
+    }
+
+    StringBuilder all = new StringBuilder();
+    
all.append("name,datatype,comment,nullable,auto_increment").append(System.lineSeparator());

Review Comment:
   I believe we had a conversation over the "autoIncrement" field ...
   It is not supposed appear on every column.



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

Reply via email to