[fix](show_proc) fix show statistic proc dir to ensure that result only contains dbs in internal catalog (#26254)
This commit is contained in:
@ -52,7 +52,7 @@ public class StatisticProcNode implements ProcNodeInterface {
|
||||
|
||||
@Override
|
||||
public ProcResult fetchResult() throws AnalysisException {
|
||||
List<DBStatistic> statistics = env.getCatalogMgr().getDbIds().parallelStream()
|
||||
List<DBStatistic> statistics = env.getInternalCatalog().getDbIds().parallelStream()
|
||||
// skip information_schema database
|
||||
.flatMap(id -> Stream.of(id == 0 ? null : env.getCatalogMgr().getDbNullable(id)))
|
||||
.filter(Objects::nonNull).map(DBStatistic::new)
|
||||
|
||||
@ -228,22 +228,6 @@ public class CatalogMgr implements Writable, GsonPostProcessable {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Long> getDbIds() {
|
||||
List<Long> dbIds = Lists.newArrayList();
|
||||
for (CatalogIf catalog : nameToCatalog.values()) {
|
||||
dbIds.addAll(catalog.getDbIds());
|
||||
}
|
||||
return dbIds;
|
||||
}
|
||||
|
||||
public List<String> getDbNames() {
|
||||
List<String> dbNames = Lists.newArrayList();
|
||||
for (CatalogIf catalog : nameToCatalog.values()) {
|
||||
dbNames.addAll(catalog.getDbNames());
|
||||
}
|
||||
return dbNames;
|
||||
}
|
||||
|
||||
private void writeLock() {
|
||||
lock.writeLock().lock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user