diff --git a/tikv-client/src/main/java/com/pingcap/tikv/catalog/Catalog.java b/tikv-client/src/main/java/com/pingcap/tikv/catalog/Catalog.java index a0d093110e..b3909e3b41 100644 --- a/tikv-client/src/main/java/com/pingcap/tikv/catalog/Catalog.java +++ b/tikv-client/src/main/java/com/pingcap/tikv/catalog/Catalog.java @@ -86,8 +86,7 @@ public List listTables(TiDBInfo db) { tableMap = loadTables(db); } Collection tables = tableMap.values(); - tables.removeIf(TiTableInfo::isView); - return ImmutableList.copyOf(tables); + return tables.stream().filter(TiTableInfo::isView).collect(Collectors.toList()); } public TiTableInfo getTable(TiDBInfo db, String tableName) {