nk1506 commented on code in PR #8907: URL: https://github.com/apache/iceberg/pull/8907#discussion_r1384561963
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java: ########## @@ -115,42 +126,13 @@ public void initialize(String inputName, Map<String, String> properties) { @Override public List<TableIdentifier> listTables(Namespace namespace) { - Preconditions.checkArgument( - isValidateNamespace(namespace), "Missing database in namespace: %s", namespace); - String database = namespace.level(0); try { - List<String> tableNames = clients.run(client -> client.getAllTables(database)); - List<TableIdentifier> tableIdentifiers; - if (listAllTables) { - tableIdentifiers = - tableNames.stream() - .map(t -> TableIdentifier.of(namespace, t)) - .collect(Collectors.toList()); + return listContents(namespace, null, table -> true); } else { - List<Table> tableObjects = - clients.run(client -> client.getTableObjectsByName(database, tableNames)); - tableIdentifiers = - tableObjects.stream() - .filter( - table -> - table.getParameters() != null - && BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE - .equalsIgnoreCase( - table - .getParameters() - .get(BaseMetastoreTableOperations.TABLE_TYPE_PROP))) - .map(table -> TableIdentifier.of(namespace, table.getTableName())) - .collect(Collectors.toList()); + return listContents(namespace, TableType.EXTERNAL_TABLE.name(), icebergPredicate()); } - - LOG.debug( - "Listing of namespace: {} resulted in the following tables: {}", - namespace, - tableIdentifiers); Review Comment: this has been moved [here](https://github.com/apache/iceberg/pull/8907/files#diff-3fdd21d335b598f5354de287be6a8830d78e381c89274f0d6bf85c4c9966b8f0R316) . Since we needed a common utility to fetch `listView` and `listTables`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org