This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new f3fed4abe [#5333] Add column title row to table column output in
Gravitino CLI (#5350)
f3fed4abe is described below
commit f3fed4abefbbec0e2df0ed28b7704ca0cb51476b
Author: Justin Mclean <[email protected]>
AuthorDate: Fri Nov 8 17:39:37 2024 +1100
[#5333] Add column title row to table column output in Gravitino CLI (#5350)
### What changes were proposed in this pull request?
Add column title row to table column output.
### Why are the changes needed?
So it's easier for a user to understand the output.
Fix: #5333
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
Compiled and tested locally.
---
.../main/java/org/apache/gravitino/cli/commands/ListColumns.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListColumns.java
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListColumns.java
index 28879ce13..9ea85a55e 100644
---
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListColumns.java
+++
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListColumns.java
@@ -68,8 +68,12 @@ public class ListColumns extends TableCommand {
String name = columns[i].name();
String dataType = columns[i].dataType().simpleString();
String comment = columns[i].comment();
- String nullable = columns[i].nullable() ? "null" : "";
- String autoIncrement = columns[i].autoIncrement() ? "auto" : "";
+ String nullable = columns[i].nullable() ? "true" : "false";
+ String autoIncrement = columns[i].autoIncrement() ? "true" : "false";
+
+ if (i == 0) {
+ all.append("name,datatype,comment,nullable,auto_increment" +
System.lineSeparator());
+ }
// TODO default values
all.append(
name