bharos commented on code in PR #9917:
URL: https://github.com/apache/gravitino/pull/9917#discussion_r2785696556


##########
core/src/main/java/org/apache/gravitino/catalog/ViewOperationDispatcher.java:
##########
@@ -68,13 +71,86 @@ public ViewOperationDispatcher(
   public View loadView(NameIdentifier ident) throws NoSuchViewException {
     LOG.info("Loading view: {}", ident);
 
-    return TreeLockUtils.doWithTreeLock(
-        ident,
-        LockType.READ,
-        () ->
-            doWithCatalog(
-                getCatalogIdentifier(ident),
-                c -> c.doWithViewOps(v -> v.loadView(ident)),
-                NoSuchViewException.class));
+    // First load with READ lock to check if view is already imported
+    EntityCombinedView entityCombinedView =
+        TreeLockUtils.doWithTreeLock(ident, LockType.READ, () -> 
internalLoadView(ident));
+
+    if (!entityCombinedView.imported()) {
+      // Load the schema to make sure the schema is imported.

Review Comment:
   ok, will keep this then. thanks



-- 
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]

Reply via email to