[fix](multi-catalog) add catalog info for show proc (#18276)
Signed-off-by: nextdreamblue <zxw520blue1@163.com>
This commit is contained in:
@ -33,10 +33,10 @@ import java.util.Map;
|
||||
*/
|
||||
public class CurrentQueryStatementsProcNode implements ProcNodeInterface {
|
||||
public static final ImmutableList<String> TITLE_NAMES = new ImmutableList.Builder<String>()
|
||||
.add("QueryId").add("ConnectionId").add("Database").add("User")
|
||||
.add("QueryId").add("ConnectionId").add("Catalog").add("Database").add("User")
|
||||
.add("ExecTime").add("SqlHash").add("Statement").build();
|
||||
|
||||
private static final int EXEC_TIME_INDEX = 4;
|
||||
private static final int EXEC_TIME_INDEX = 5;
|
||||
|
||||
@Override
|
||||
public ProcResult fetchResult() throws AnalysisException {
|
||||
@ -50,6 +50,7 @@ public class CurrentQueryStatementsProcNode implements ProcNodeInterface {
|
||||
final List<String> values = Lists.newArrayList();
|
||||
values.add(item.getQueryId());
|
||||
values.add(item.getConnId());
|
||||
values.add(item.getCatalog());
|
||||
values.add(item.getDb());
|
||||
values.add(item.getUser());
|
||||
values.add(item.getQueryExecTime());
|
||||
|
||||
@ -35,10 +35,10 @@ import java.util.Map;
|
||||
*/
|
||||
public class CurrentQueryStatisticsProcDir implements ProcDirInterface {
|
||||
public static final ImmutableList<String> TITLE_NAMES = new ImmutableList.Builder<String>()
|
||||
.add("QueryId").add("ConnectionId").add("Database").add("User")
|
||||
.add("QueryId").add("ConnectionId").add("Catalog").add("Database").add("User")
|
||||
.add("ScanBytes").add("ProcessRows").add("ExecTime").build();
|
||||
|
||||
private static final int EXEC_TIME_INDEX = 6;
|
||||
private static final int EXEC_TIME_INDEX = 7;
|
||||
|
||||
@Override
|
||||
public boolean register(String name, ProcNodeInterface node) {
|
||||
@ -73,6 +73,7 @@ public class CurrentQueryStatisticsProcDir implements ProcDirInterface {
|
||||
final List<String> values = Lists.newArrayList();
|
||||
values.add(item.getQueryId());
|
||||
values.add(item.getConnId());
|
||||
values.add(item.getCatalog());
|
||||
values.add(item.getDb());
|
||||
values.add(item.getUser());
|
||||
if (item.getIsReportSucc()) {
|
||||
|
||||
@ -169,6 +169,7 @@ public final class QeProcessorImpl implements QeProcessor {
|
||||
.user(context.getQualifiedUser())
|
||||
.connId(String.valueOf(context.getConnectionId()))
|
||||
.db(context.getDatabase())
|
||||
.catalog(context.getDefaultCatalog())
|
||||
.fragmentInstanceInfos(info.getCoord().getFragmentInstanceInfos())
|
||||
.profile(info.getCoord().getQueryProfile())
|
||||
.isReportSucc(context.getSessionVariable().enableProfile()).build();
|
||||
|
||||
@ -30,6 +30,7 @@ public final class QueryStatisticsItem {
|
||||
private final String queryId;
|
||||
private final String user;
|
||||
private final String sql;
|
||||
private final String catalog;
|
||||
private final String db;
|
||||
private final String connId;
|
||||
private final long queryStartTime;
|
||||
@ -42,6 +43,7 @@ public final class QueryStatisticsItem {
|
||||
this.queryId = builder.queryId;
|
||||
this.user = builder.user;
|
||||
this.sql = builder.sql;
|
||||
this.catalog = builder.catalog;
|
||||
this.db = builder.db;
|
||||
this.connId = builder.connId;
|
||||
this.queryStartTime = builder.queryStartTime;
|
||||
@ -54,6 +56,10 @@ public final class QueryStatisticsItem {
|
||||
return db;
|
||||
}
|
||||
|
||||
public String getCatalog() {
|
||||
return catalog;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
@ -89,6 +95,7 @@ public final class QueryStatisticsItem {
|
||||
|
||||
public static final class Builder {
|
||||
private String queryId;
|
||||
private String catalog;
|
||||
private String db;
|
||||
private String user;
|
||||
private String sql;
|
||||
@ -112,6 +119,11 @@ public final class QueryStatisticsItem {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder catalog(String catalog) {
|
||||
this.catalog = catalog;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder user(String user) {
|
||||
this.user = user;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user