mchades commented on code in PR #10998:
URL: https://github.com/apache/gravitino/pull/10998#discussion_r3257865445
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -398,6 +408,17 @@ public NameIdentifier[] listTables(Namespace namespace)
throws NoSuchSchemaExcep
catalogName, schemaIdent.name(), hudiFilter,
MAX_TABLES));
removeHudiTables(allTables, hudiTables);
}
+
+ // Always filter out VIRTUAL_VIEW entries so they don't appear in table
listings
+ String viewFilter =
+ String.format("%stableType like \"VIRTUAL_VIEW\"",
HIVE_FILTER_FIELD_PARAMS);
+ List<String> views =
+ clientPool.run(
+ c ->
+ c.listTableNamesByFilter(
+ catalogName, schemaIdent.name(), viewFilter,
MAX_TABLES));
+ allTables.removeAll(views);
Review Comment:
I prefer the current approach of direct invocation. Changing to call
listViews would make the code less intuitive, as it would require an additional
level of navigation to understand the logic behind listViews. Furthermore,
listViews already have their own exception handling mechanisms, which could
lead to unclear error reporting when issues occur here. This would also result
in redundant processing steps.
--
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]