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


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListTableProperties.java:
##########
@@ -59,11 +59,17 @@ public ListTableProperties(
   /** List the properties of a table. */
   @Override
   public void handle() {
-    Table gTable = null;
-    try {
+    try (GravitinoClient client = buildClient(metalake)) { // Ensures resource 
cleanup
       NameIdentifier name = NameIdentifier.of(schema, table);
-      GravitinoClient client = buildClient(metalake);
-      gTable = client.loadCatalog(catalog).asTableCatalog().loadTable(name);
+      Table gTable = 
client.loadCatalog(catalog).asTableCatalog().loadTable(name);
+
+      if (gTable == null) {
+        exitWithError("Table not found: " + table);
+        return;
+      }
+
+      Map<String, String> properties = gTable.properties();
+      printProperties(properties);

Review Comment:
   Please move outside of try block.



-- 
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...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to