mchades commented on code in PR #12626:
URL: https://github.com/apache/gravitino/pull/12626#discussion_r4133773835
##########
server/src/main/java/org/apache/gravitino/server/web/rest/SemanticModelOperations.java:
##########
@@ -63,6 +72,44 @@ public SemanticModelOperations(SemanticModelDispatcher
dispatcher) {
this.dispatcher = dispatcher;
}
+ /**
+ * Lists Semantic Models in a schema.
+ *
+ * @param metalake The metalake name.
+ * @param catalog The catalog name.
+ * @param schema The schema name.
+ * @return A response containing Semantic Model identifiers.
+ */
+ @GET
+ @Produces("application/vnd.gravitino.v1+json")
+ @Timed(name = "list-semantic-model." + MetricNames.HTTP_PROCESS_DURATION,
absolute = true)
+ @ResponseMetered(name = "list-semantic-model", absolute = true)
+ public Response listSemanticModels(
+ @PathParam("metalake") String metalake,
+ @PathParam("catalog") String catalog,
+ @PathParam("schema") String schema) {
+ LOG.info(
+ "Received list Semantic Models request for schema: {}.{}.{}",
metalake, catalog, schema);
+ try {
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ Namespace namespace = NamespaceUtil.ofSemanticModel(metalake,
catalog, schema);
+ NameIdentifier[] identifiers =
dispatcher.listSemanticModels(namespace);
+ identifiers = identifiers == null ? new NameIdentifier[0] :
identifiers;
Review Comment:
Removed the unreachable null fallback and the matching `thenReturn(null)`
test in 410d754242. The endpoint now relies on the dispatcher contract,
consistent with the other list endpoints.
--
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]