Skip to content

Commit

Permalink
Fix CLI output consistency and improve resource handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijeshthummar02 committed Mar 3, 2025
1 parent 42ca8c9 commit 349b343
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public void handle() {

try (GravitinoClient client = buildClient(metalake)) {
gCatalog = client.loadCatalog(catalog);
} catch (NoSuchMetalakeException err) {
exitWithError(ErrorMessages.UNKNOWN_METALAKE);
} catch (NoSuchCatalogException err) {
exitWithError(ErrorMessages.UNKNOWN_CATALOG);
} catch (Exception exp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,17 @@ public void handle() {
}

StringBuilder all = new StringBuilder();
all.append("name,datatype,comment,nullable,auto_increment").append(System.lineSeparator());
all.append("name\tdatatype\tcomment\tnullable\tauto_increment").append(System.lineSeparator());

for (Column column : columns) {
if (column == null) {
continue;
}

all.append(column.name()).append(",");
all.append(column.dataType() != null ? column.dataType().simpleString() : "UNKNOWN")
.append(",");
all.append(column.comment() != null ? column.comment() : "N/A").append(",");
all.append(column.nullable() ? "true" : "false").append(",");
all.append(column.name()).append("\t");
all.append(column.dataType() != null ? column.dataType().simpleString() : "UNKNOWN").append("\t");
all.append(column.comment() != null ? column.comment() : "N/A").append("\t");
all.append(column.nullable() ? "true" : "false").append("\t");
all.append(column.autoIncrement() ? "true" : "false");
all.append(System.lineSeparator());
}
Expand Down

0 comments on commit 349b343

Please sign in to comment.