Skip to content

Commit

Permalink
[hive] Make HiveCatalog.listTables Lighter weight
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Nov 11, 2024
1 parent 85f563b commit 7021e91
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,14 @@ protected List<String> listTablesImpl(String databaseName) {
try {
List<String> allTables = clients.run(client -> client.getAllTables(databaseName));
List<String> result = new ArrayList<>(allTables.size());
for (String table : allTables) {
for (String t : allTables) {
try {
getTable(new Identifier(databaseName, table));
result.add(table);
Identifier identifier = new Identifier(databaseName, t);
Table table = getHmsTable(identifier);
if (isPaimonTable(identifier, table)
|| (!formatTableDisabled() && isFormatTable(table))) {
result.add(t);
}
} catch (TableNotExistException ignored) {
}
}
Expand Down

0 comments on commit 7021e91

Please sign in to comment.