CuteChuanChuan commented on code in PR #13217:
URL: https://github.com/apache/iceberg/pull/13217#discussion_r2166781068
##########
bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreClientImpl.java:
##########
@@ -486,21 +489,28 @@ public List<Tables> list(DatasetReference
datasetReference, boolean listAllTable
// tables for us to filter out those results since invoking `getTable`
on them would
// correctly raise a `NoSuchIcebergTableException` for being inoperable
by this plugin.
if (!listAllTables) {
- tablesStream =
- tablesStream
- .parallel()
- .filter(
- table -> {
- try {
- load(table.getTableReference());
- } catch (NoSuchTableException e) {
- return false;
- }
- return true;
- });
+ List<Tables> allTables = tablesStream.collect(Collectors.toList());
+ List<Tables> validTables =
Collections.synchronizedList(Lists.newArrayList());
+
+ Tasks.foreach(allTables)
+ .executeWith(ThreadPools.getWorkerPool())
+ .noRetry()
+ .suppressFailureWhenFinished()
+ .run(
+ table -> {
+ try {
+ load(table.getTableReference());
+ validTables.add(table);
+ } catch (NoSuchTableException e) {
+ // Silently ignore tables that are not valid Iceberg tables
+ // This is expected behavior as we're filtering out
non-Iceberg tables
+ }
+ });
+
+ return validTables;
+ } else {
+ return tablesStream.collect(Collectors.toList());
Review Comment:
Thanks for pointing this out!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]