Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Sep 13, 2024
1 parent 5984eb0 commit 01bfca7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@

public class ShowClusterStmt extends ShowStmt implements NotFallbackInParser {
public static final ImmutableList<String> CLUSTER_TITLE_NAMES = new ImmutableList.Builder<String>()
.add("cluster").add("is_current").add("users").build();
.add("cluster").add("is_current").add("users").add("backend_num").build();

public static final ImmutableList<String> COMPUTE_GROUP_TITLE_NAMES = new ImmutableList.Builder<String>()
.add("Name").add("IsCurrent").add("Users").build();
.add("Name").add("IsCurrent").add("Users").add("BackendNum").build();

boolean isComputeGroup = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,12 @@ private void handleShowCluster() throws AnalysisException {
PrivPredicate.of(PrivBitSet.of(Privilege.ADMIN_PRIV), Operator.OR))) {
users.removeIf(user -> !user.equals(ClusterNamespace.getNameFromFullName(ctx.getQualifiedUser())));
}

String result = Joiner.on(", ").join(users);
row.add(result);
int backendNum = ((CloudSystemInfoService) Env.getCurrentEnv().getCurrentSystemInfo())
.getBackendsByClusterName(clusterName).size();
row.add(String.valueOf(backendNum));
rows.add(row);
}

Expand Down

0 comments on commit 01bfca7

Please sign in to comment.