xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181968684


##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/ModelVersionMetaBaseSQLProvider.java:
##########
@@ -172,8 +182,24 @@ public String updateModelVersionMeta(
         + "AND version = #{oldModelVersionMeta.modelVersion} "
         + "AND model_version_comment = 
#{oldModelVersionMeta.modelVersionComment} "
         + "AND model_version_properties = 
#{oldModelVersionMeta.modelVersionProperties} "
-        + "AND model_version_uri = #{oldModelVersionMeta.modelVersionUri} "
         + "AND audit_info = #{oldModelVersionMeta.auditInfo} "
         + "AND deleted_at = 0";
   }
+
+  public String updateModelVersionUris(
+      @Param("modelId") Long modelId,
+      @Param("modelVersion") Integer modelVersion,
+      @Param("uris") Map<String, String> uris) {
+    return "<script>"
+        + "UPDATE "
+        + ModelVersionMetaMapper.TABLE_NAME
+        + " SET"
+        + " model_version_uri = CASE"
+        + "<foreach collection='uris' index='k' item='v' separator=''>"
+        + " WHEN model_version_uri_name = #{k} THEN #{v}"
+        + "</foreach>"
+        + " ELSE model_version_uri END"
+        + " WHERE model_id = #{modelId} AND version = #{modelVersion} AND 
deleted_at = 0"
+        + "</script>";

Review Comment:
   This PR does not cover that, it will be resolved in another subtask(#7440). 
   The method here only supports updating the URI corresponding to an existing 
URI name, in the subsequent work, I will add support for adding and deleting 
URIs.



-- 
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]

Reply via email to