mchades commented on code in PR #12833:
URL: https://github.com/apache/gravitino/pull/12833#discussion_r4121868170
##########
core/src/main/java/org/apache/gravitino/catalog/ManagedSemanticModelOperations.java:
##########
@@ -71,9 +73,17 @@ public ManagedSemanticModelOperations(
@Override
public NameIdentifier[] listSemanticModels(Namespace namespace) throws
NoSuchSchemaException {
- // TODO: Implement in the Semantic Model list/alter/drop capability.
- throw new UnsupportedOperationException(
- "listSemanticModels: list/alter/drop capability is not implemented");
+ try {
+ List<SemanticModelEntity> models =
+ store.list(namespace, SemanticModelEntity.class,
Entity.EntityType.SEMANTIC_MODEL);
+ return models.stream()
+ .map(model -> NameIdentifier.of(namespace, model.name()))
+ .toArray(NameIdentifier[]::new);
Review Comment:
This follows the existing managed-entity listing pattern. Table, Fileset,
Model, View, and Function all obtain entities through `EntityStore.list` before
their callers extract identifiers, and most JDBC branches do not use the
`allFields` flag. Table already avoids loading its separately stored columns,
while Fileset, View, and Function still materialize their current version
payloads.
Semantic Model therefore does not introduce a new correctness behavior here.
A names-only projection would be a broader EntityStore/JDBC optimization that
should be addressed consistently across entity types rather than in this Core
lifecycle PR.
--
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]