mchades commented on code in PR #10879:
URL: https://github.com/apache/gravitino/pull/10879#discussion_r3152006333
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/ViewMetaService.java:
##########
@@ -158,104 +151,81 @@ public GenericEntity getViewByIdentifier(NameIdentifier
identifier) {
metricsSource = GRAVITINO_RELATIONAL_STORE_METRIC_NAME,
baseMetricName = "insertViewFromEntity")
public void insertView(GenericEntity entity, boolean overwrite) throws
IOException {
- Namespace namespace = entity.namespace();
- NamespaceUtil.checkView(namespace);
-
- ViewPO.Builder builder = createViewPOBuilder(namespace);
- ViewPO viewPO =
- builder
- .withViewId(entity.id())
- .withViewName(entity.name())
- .withCurrentVersion(1L)
- .withLastVersion(1L)
- .withDeletedAt(0L)
+ NamespaceUtil.checkView(entity.namespace());
+
+ ViewEntity viewEntity =
+ ViewEntity.builder()
+ .withId(entity.id())
+ .withName(entity.name())
+ .withNamespace(entity.namespace())
+ .withColumns(new Column[0])
+ .withRepresentations(
+ new Representation[] {
+
SQLRepresentation.builder().withDialect("unknown").withSql("placeholder").build()
+ })
+ .withAuditInfo(AuditInfo.EMPTY)
.build();
-
- insertView(viewPO, overwrite);
+ insertView(viewEntity, overwrite);
}
Review Comment:
Fixed by removing the `GenericEntity`-based view insert path entirely. View
metadata is now persisted only through `ViewEntity`, so this code no longer
synthesizes placeholder columns or representations for views.
--
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]