jerryshao commented on code in PR #10879:
URL: https://github.com/apache/gravitino/pull/10879#discussion_r3160538885
##########
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:
If we import the view from external source to Gravitino, shall we still need
to combine them, I think they're the same, am I right?
--
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]