diff --git a/core/src/test/scala/org/apache/spark/sql/ViewTestSuite.scala b/core/src/test/scala/org/apache/spark/sql/ViewTestSuite.scala index 65d87c7f6e..5fa91a2d53 100644 --- a/core/src/test/scala/org/apache/spark/sql/ViewTestSuite.scala +++ b/core/src/test/scala/org/apache/spark/sql/ViewTestSuite.scala @@ -19,6 +19,8 @@ class ViewTestSuite extends BaseTiSparkSuite { judge(s"select * from $table") intercept[AnalysisException](spark.sql("select * from v")) + + spark.sql("show tables").show(false) } private def dropTbl() = { 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 870a8af0de..faf1cb8feb 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 @@ -80,8 +80,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(tbl -> !tbl.isView()).collect(Collectors.toList()); } public TiTableInfo getTable(TiDBInfo db, String tableName) {