Skip to content

Commit

Permalink
using stream rather removeIf (#1057) (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany authored Dec 11, 2019
1 parent 184c912 commit 12cabd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/src/test/scala/org/apache/spark/sql/ViewTestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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() = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ public List<TiTableInfo> listTables(TiDBInfo db) {
tableMap = loadTables(db);
}
Collection<TiTableInfo> 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) {
Expand Down

0 comments on commit 12cabd3

Please sign in to comment.