mchades commented on code in PR #12626:
URL: https://github.com/apache/gravitino/pull/12626#discussion_r4133809521
##########
server/src/main/java/org/apache/gravitino/server/web/rest/SemanticModelOperations.java:
##########
@@ -157,4 +204,103 @@ public Response loadSemanticModel(
OperationType.LOAD, semanticModel, schema, e);
}
}
+
+ /**
+ * Alters a Semantic Model atomically.
+ *
+ * @param metalake The metalake name.
+ * @param catalog The catalog name.
+ * @param schema The schema name.
+ * @param semanticModel The current Semantic Model name.
+ * @param request The updates to apply.
+ * @return A response containing the altered Semantic Model.
+ */
+ @PUT
+ @Path("{semanticModel}")
+ @Produces("application/vnd.gravitino.v1+json")
+ @Timed(name = "alter-semantic-model." + MetricNames.HTTP_PROCESS_DURATION,
absolute = true)
+ @ResponseMetered(name = "alter-semantic-model", absolute = true)
+ public Response alterSemanticModel(
+ @PathParam("metalake") String metalake,
+ @PathParam("catalog") String catalog,
+ @PathParam("schema") String schema,
+ @PathParam("semanticModel") String semanticModel,
+ SemanticModelUpdatesRequest request) {
+ LOG.info(
+ "Received alter Semantic Model request: {}.{}.{}.{}",
+ metalake,
+ catalog,
+ schema,
+ semanticModel);
+ try {
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ if (request == null) {
+ throw new IllegalArgumentException("Request body must not be
null");
+ }
Review Comment:
Added `putJson` and `testAlterSemanticModelRejectsNullBody` in 410d754242.
The test sends literal JSON `null`, asserts 400 with `Request body must not be
null`, and verifies no dispatcher interaction.
--
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]