mchades commented on code in PR #10879:
URL: https://github.com/apache/gravitino/pull/10879#discussion_r3164824684


##########
core/src/main/java/org/apache/gravitino/catalog/ViewOperationDispatcher.java:
##########
@@ -135,22 +170,45 @@ private EntityCombinedView importView(NameIdentifier 
ident) throws NoSuchViewExc
 
     LOG.info("Auto-importing view {} into Gravitino entity store", ident);
     long uid = idGenerator.nextId();
-    GenericEntity newViewEntity =
-        GenericEntity.builder()
-            .withId(uid)
-            .withName(ident.name())
-            .withNamespace(ident.namespace())
-            .withEntityType(Entity.EntityType.VIEW)
-            .build();
+    View catalogView = entityCombinedView.viewFromCatalog();
+    ViewEntity newViewEntity = buildViewEntityForImport(uid, ident, 
catalogView);
     try {
       store.put(newViewEntity, false /* overwrite */);
       LOG.info("Successfully imported view {} into entity store with id {}", 
ident, uid);
-      return EntityCombinedView.of(entityCombinedView.viewFromCatalog(), 
newViewEntity)
-          .withImported(true);
+      return EntityCombinedView.of(catalogView, 
newViewEntity).withImported(true);

Review Comment:
   Different catalogs support views to varying degrees, so combining them with 
viewEntity is necessary. Specific handling will be added in subsequent PRs.



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