You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "xiaozcy (via GitHub)" <gi...@apache.org> on 2025/06/30 12:16:29 UTC
[PR] feat(model): Backend supports multiple URIs for model version [gravitino]
xiaozcy opened a new pull request, #7502:
URL: https://github.com/apache/gravitino/pull/7502
### What changes were proposed in this pull request?
(Please outline the changes and how this PR fixes the issue.)
Backend supports multiple URIs for model version.
(Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, describe the bug.)
Fix: #7381
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
UTs.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184223404
##########
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:
I don't think the code here needs to be changed again. Multiple URIs cannot be updated in a single sql statement, it needs to be achieved through one `INSERT` statement, one `UPDATE` statement, and one `DELETE` statement (if hard). Therefore, only two additional sql statements need to be added to support the completed update.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184260183
##########
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:
Yeah, that's what I mean, the logic is more than the query here.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184277021
##########
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:
Agree. I tend to implement this part of the logic in subsequent subtask, only compatibility is maintained in this 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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#issuecomment-3030429926
@mchades would you please also take a review?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2176332169
##########
core/src/main/java/org/apache/gravitino/storage/relational/utils/POConverters.java:
##########
@@ -1474,21 +1484,31 @@ public static List<ModelVersionAliasRelPO> updateModelVersionAliasRelPO(
}
}
- public static ModelVersionPO initializeModelVersionPO(
- ModelVersionEntity modelVersionEntity, ModelVersionPO.Builder builder) {
+ public static List<ModelVersionPO> initializeModelVersionPO(
+ ModelVersionEntity modelVersionEntity, Long modelId) {
try {
- return builder
- // Note that version set here will not be used when inserting into database, it will
- // directly use the version from the query to avoid concurrent version conflict.
- .withModelVersion(modelVersionEntity.version())
- .withModelVersionComment(modelVersionEntity.comment())
- .withModelVersionUri(modelVersionEntity.uri())
- .withModelVersionProperties(
- JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.properties()))
- .withAuditInfo(
- JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.auditInfo()))
- .withDeletedAt(DEFAULT_DELETED_AT)
- .build();
+ String modelVersionProperties =
+ JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.properties());
+ String modelVersionAuditInfo =
+ JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.auditInfo());
+ return modelVersionEntity.uris().entrySet().stream()
+ .map(
+ entry ->
+ ModelVersionPO.builder()
+ .withModelId(modelId)
+ // Note that version set here will not be used when inserting into database,
+ // it will
+ // directly use the version from the query to avoid concurrent version
Review Comment:
Fixed.
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/ModelVersionMetaService.java:
##########
@@ -321,26 +329,53 @@ public <E extends Entity & HasIdentifier> ModelVersionEntity updateModelVersion(
try {
SessionUtils.doMultipleWithCommit(
() ->
- updateResult.set(
+ updateResult.addAndGet(
SessionUtils.doWithoutCommitAndFetchResult(
ModelVersionMetaMapper.class,
mapper ->
mapper.updateModelVersionMeta(
POConverters.updateModelVersionPO(
- oldModelVersionPO, newModelVersionEntity),
- oldModelVersionPO))),
+ oldModelVersionPOs.get(0), newModelVersionEntity),
+ oldModelVersionPOs.get(0)))),
+ // TODO Only modifying the unknown URI is supported currently.
+ () ->
+ oldModelVersionPOs.stream()
+ .filter(
+ v ->
+ ModelVersion.URI_NAME_UNKNOWN.equals(v.getModelVersionUriName())
Review Comment:
Fixed.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181521132
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -503,7 +504,7 @@ private ModelVersionImpl toModelVersionImpl(ModelVersionEntity modelVersion) {
return ModelVersionImpl.builder()
.withVersion(modelVersion.version())
.withAliases(modelVersion.aliases().toArray(new String[0]))
- .withUri(modelVersion.uri())
+ .withUri(modelVersion.uris().get(ModelVersion.URI_NAME_UNKNOWN))
Review Comment:
Where are the code changes to support multiple URIs in this class?
##########
core/src/main/java/org/apache/gravitino/meta/ModelVersionEntity.java:
##########
@@ -45,8 +46,8 @@ public class ModelVersionEntity implements Entity, Auditable, HasIdentifier {
Field.optional("comment", String.class, "The comment or description of the model entity.");
public static final Field ALIASES =
Field.optional("aliases", List.class, "The aliases of the model entity.");
- public static final Field URL =
- Field.required("uri", String.class, "The URI of the model entity.");
+ public static final Field URIS =
+ Field.required("uris", Map.class, "The URI and their names of the model entity.");
Review Comment:
The description here is not correct.
##########
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} "
Review Comment:
Why do we remove this?
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/ModelVersionMetaBaseSQLProvider.java:
##########
@@ -26,51 +28,60 @@
public class ModelVersionMetaBaseSQLProvider {
- public String insertModelVersionMeta(@Param("modelVersionMeta") ModelVersionPO modelVersionPO) {
- return "INSERT INTO "
+ public String insertModelVersionMetas(
+ @Param("modelVersionMetas") List<ModelVersionPO> modelVersionPOs) {
+ return "<script>"
+ + "INSERT INTO "
+ ModelVersionMetaMapper.TABLE_NAME
- + "(metalake_id, catalog_id, schema_id, model_id, version,"
- + " model_version_comment, model_version_properties, model_version_uri,"
- + " audit_info, deleted_at)"
- + " SELECT metalake_id, catalog_id, schema_id, model_id, model_latest_version,"
- + " #{modelVersionMeta.modelVersionComment}, #{modelVersionMeta.modelVersionProperties},"
- + " #{modelVersionMeta.modelVersionUri}, #{modelVersionMeta.auditInfo},"
- + " #{modelVersionMeta.deletedAt}"
+ + "(metalake_id, catalog_id, schema_id, model_id, version, model_version_comment,"
+ + " model_version_properties, model_version_uri_name, model_version_uri, audit_info, deleted_at)"
+ + " SELECT m.metalake_id, m.catalog_id, m.schema_id, m.model_id, m.model_latest_version, v.model_version_comment,"
+ + " v.model_version_properties, v.model_version_uri_name, v.model_version_uri, v.audit_info, v.deleted_at"
+ + " FROM ("
+ + "<foreach collection='modelVersionMetas' item='version' separator='UNION ALL'>"
+ + " SELECT"
+ + " #{version.modelId} AS model_id, #{version.modelVersionComment} AS model_version_comment,"
+ + " #{version.modelVersionProperties} AS model_version_properties, #{version.auditInfo} AS audit_info,"
+ + " #{version.deletedAt} AS deleted_at, #{version.modelVersionUriName} AS model_version_uri_name,"
+ + " #{version.modelVersionUri} AS model_version_uri "
+ + "</foreach>"
+ + " ) v"
+ + " JOIN"
+ + " (SELECT metalake_id, catalog_id, schema_id, model_id, model_latest_version"
+ " FROM "
+ ModelMetaMapper.TABLE_NAME
- + " WHERE model_id = #{modelVersionMeta.modelId} AND deleted_at = 0";
+ + " WHERE model_id = #{modelVersionMetas[0].modelId} AND deleted_at = 0) m"
+ + " ON v.model_id = m.model_id"
+ + "</script>";
Review Comment:
One uri will be inserted as one recode, so multiple uris of one model version will have multiple records, am I right?
##########
core/src/test/java/org/apache/gravitino/storage/relational/service/TestModelVersionMetaService.java:
##########
@@ -752,7 +771,7 @@ void testUpdateModelVersionAliases() throws IOException {
createModelVersionEntity(
modelVersionEntity.modelIdentifier(),
modelVersionEntity.version(),
- modelVersionEntity.uri(),
+ modelVersionEntity.uris(),
Review Comment:
The test cases here is not enough to cover your changes, you only change to make the code work, doesn't actually test your changes.
##########
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:
How do you handle the scenario where the number of URIs is different before and after? For example, if you have 2 old URIs, now you update the URIs to have 3 new URIs, and vice versa?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2176311950
##########
core/src/main/java/org/apache/gravitino/meta/ModelVersionEntity.java:
##########
@@ -133,6 +134,13 @@ public Long id() {
throw new UnsupportedOperationException("Model version entity does not have an ID.");
}
+ @Override
+ public void validate() throws IllegalArgumentException {
+ Entity.super.validate();
+ Preconditions.checkArgument(
+ !uris.isEmpty(), "The uri of the model version entity must not be empty.");
Review Comment:
A model version must have one URI at least.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184206588
##########
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:
I think the URI updating is quite complex for the multiple URI scenario; the code changes here may need changed again.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184206588
##########
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:
I think the URI updating is quite complex for the multiple URI scenario; the code changes here may need changes again.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184267638
##########
scripts/h2/upgrade-0.9.0-to-1.0.0-h2.sql:
##########
@@ -60,4 +60,11 @@ CREATE TABLE IF NOT EXISTS `policy_relation_meta` (
UNIQUE KEY `uk_pi_mi_mo_del` (`policy_id`, `metadata_object_id`, `metadata_object_type`, `deleted_at`),
KEY `idx_pid` (`policy_id`),
KEY `idx_mid` (`metadata_object_id`)
-) ENGINE=InnoDB;
\ No newline at end of file
+) ENGINE=InnoDB;
+
+-- using default 'unknown' to fill in the new column for compatibility
+ALTER TABLE `model_version_info` ADD COLUMN `model_version_uri_name` VARCHAR(256) NOT NULL DEFAULT 'unknown' COMMENT 'model version uri name';
+ALTER TABLE `model_version_info` DROP INDEX `uk_mid_ver_del`;
+ALTER TABLE `model_version_info` ADD CONSTRAINT `uk_mid_ver_uri_del` UNIQUE (`model_id`, `version`, `model_version_uri_name`, `deleted_at`);
+-- remove the default value for model_version_uri_name
+ALTER TABLE `model_version_info` ALTER COLUMN `model_version_uri_name` DROP DEFAULT;
Review Comment:
The filed `model_version_uri_name` should not have a default value, the default value is used for compatibility with previous data. After setting default value for the previous data, the default value of the field should be dropped.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2182205014
##########
core/src/test/java/org/apache/gravitino/storage/relational/service/TestModelVersionMetaService.java:
##########
@@ -752,7 +771,7 @@ void testUpdateModelVersionAliases() throws IOException {
createModelVersionEntity(
modelVersionEntity.modelIdentifier(),
modelVersionEntity.version(),
- modelVersionEntity.uri(),
+ modelVersionEntity.uris(),
Review Comment:
New tests are added to cover model version operations with multiple 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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2176317586
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/h2/ModelVersionMetaH2Provider.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.storage.relational.mapper.provider.h2;
+
+import java.util.List;
+import org.apache.gravitino.storage.relational.mapper.ModelMetaMapper;
+import org.apache.gravitino.storage.relational.mapper.ModelVersionMetaMapper;
+import org.apache.gravitino.storage.relational.mapper.provider.base.ModelVersionMetaBaseSQLProvider;
+import org.apache.gravitino.storage.relational.po.ModelVersionPO;
+import org.apache.ibatis.annotations.Param;
+
+public class ModelVersionMetaH2Provider extends ModelVersionMetaBaseSQLProvider {
+
+ public String insertModelVersionMetas(
+ @Param("modelVersionMetas") List<ModelVersionPO> modelVersionPOs) {
+ return "<script>"
+ + "INSERT INTO "
+ + ModelVersionMetaMapper.TABLE_NAME
+ + "(metalake_id, catalog_id, schema_id, model_id, version, model_version_comment,"
+ + " model_version_properties, model_version_uri_name, model_version_uri, audit_info, deleted_at)"
+ + " SELECT m.metalake_id, m.catalog_id, m.schema_id, m.model_id, m.model_latest_version, v.model_version_comment,"
+ + " v.model_version_properties, v.model_version_uri_name, v.model_version_uri, v.audit_info, v.deleted_at"
+ + " FROM ("
+ + "<foreach collection='modelVersionMetas' item='version' separator='UNION ALL'>"
+ + " SELECT"
+ + " CAST(#{version.modelId} AS BIGINT) AS model_id, CAST(#{version.modelVersionComment} AS TEXT) AS model_version_comment,"
Review Comment:
When using syntax like `SELECT 1 AS column_name`, H2 does not recognize the type of the field, while MySQL and PostgreSQL can. So I use `CAST` to declare the type explicitly.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2177698135
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -477,7 +478,7 @@ private ModelVersionEntity updateModelVersionEntity(
.withModelIdentifier(entityModelIdentifier)
.withAliases(entityAliases)
.withComment(entityComment)
- .withUri(entityUri)
+ .withUris(ImmutableMap.of(ModelVersion.URI_NAME_UNKNOWN, entityUri))
Review Comment:
I see.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181966171
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -503,7 +504,7 @@ private ModelVersionImpl toModelVersionImpl(ModelVersionEntity modelVersion) {
return ModelVersionImpl.builder()
.withVersion(modelVersion.version())
.withAliases(modelVersion.aliases().toArray(new String[0]))
- .withUri(modelVersion.uri())
+ .withUri(modelVersion.uris().get(ModelVersion.URI_NAME_UNKNOWN))
Review Comment:
This PR only updates the backend storage schema and logic, and is compatible with the usage of a single URI. The usage of multiple URIs on the front end will be implemented in the next subtask(#7382).
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #7502:
URL: https://github.com/apache/gravitino/pull/7502
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181967625
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/ModelVersionMetaBaseSQLProvider.java:
##########
@@ -26,51 +28,60 @@
public class ModelVersionMetaBaseSQLProvider {
- public String insertModelVersionMeta(@Param("modelVersionMeta") ModelVersionPO modelVersionPO) {
- return "INSERT INTO "
+ public String insertModelVersionMetas(
+ @Param("modelVersionMetas") List<ModelVersionPO> modelVersionPOs) {
+ return "<script>"
+ + "INSERT INTO "
+ ModelVersionMetaMapper.TABLE_NAME
- + "(metalake_id, catalog_id, schema_id, model_id, version,"
- + " model_version_comment, model_version_properties, model_version_uri,"
- + " audit_info, deleted_at)"
- + " SELECT metalake_id, catalog_id, schema_id, model_id, model_latest_version,"
- + " #{modelVersionMeta.modelVersionComment}, #{modelVersionMeta.modelVersionProperties},"
- + " #{modelVersionMeta.modelVersionUri}, #{modelVersionMeta.auditInfo},"
- + " #{modelVersionMeta.deletedAt}"
+ + "(metalake_id, catalog_id, schema_id, model_id, version, model_version_comment,"
+ + " model_version_properties, model_version_uri_name, model_version_uri, audit_info, deleted_at)"
+ + " SELECT m.metalake_id, m.catalog_id, m.schema_id, m.model_id, m.model_latest_version, v.model_version_comment,"
+ + " v.model_version_properties, v.model_version_uri_name, v.model_version_uri, v.audit_info, v.deleted_at"
+ + " FROM ("
+ + "<foreach collection='modelVersionMetas' item='version' separator='UNION ALL'>"
+ + " SELECT"
+ + " #{version.modelId} AS model_id, #{version.modelVersionComment} AS model_version_comment,"
+ + " #{version.modelVersionProperties} AS model_version_properties, #{version.auditInfo} AS audit_info,"
+ + " #{version.deletedAt} AS deleted_at, #{version.modelVersionUriName} AS model_version_uri_name,"
+ + " #{version.modelVersionUri} AS model_version_uri "
+ + "</foreach>"
+ + " ) v"
+ + " JOIN"
+ + " (SELECT metalake_id, catalog_id, schema_id, model_id, model_latest_version"
+ " FROM "
+ ModelMetaMapper.TABLE_NAME
- + " WHERE model_id = #{modelVersionMeta.modelId} AND deleted_at = 0";
+ + " WHERE model_id = #{modelVersionMetas[0].modelId} AND deleted_at = 0) m"
+ + " ON v.model_id = m.model_id"
+ + "</script>";
Review Comment:
Yes.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181968001
##########
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} "
Review Comment:
As you said before, multiple URIs of one model version will have multiple records. When updating fields other than URIs, all records should be updated. However, when updating URIs, only the corresponding records need to be updated. Therefore, only the fields other than the URI will be updated here, and the update of URIs needs to be handled separately.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2181967469
##########
core/src/main/java/org/apache/gravitino/meta/ModelVersionEntity.java:
##########
@@ -45,8 +46,8 @@ public class ModelVersionEntity implements Entity, Auditable, HasIdentifier {
Field.optional("comment", String.class, "The comment or description of the model entity.");
public static final Field ALIASES =
Field.optional("aliases", List.class, "The aliases of the model entity.");
- public static final Field URL =
- Field.required("uri", String.class, "The URI of the model entity.");
+ public static final Field URIS =
+ Field.required("uris", Map.class, "The URI and their names of the model entity.");
Review Comment:
Updated to "The URIs and their names of the model version entity."
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184224273
##########
scripts/h2/upgrade-0.9.0-to-1.0.0-h2.sql:
##########
@@ -60,4 +60,11 @@ CREATE TABLE IF NOT EXISTS `policy_relation_meta` (
UNIQUE KEY `uk_pi_mi_mo_del` (`policy_id`, `metadata_object_id`, `metadata_object_type`, `deleted_at`),
KEY `idx_pid` (`policy_id`),
KEY `idx_mid` (`metadata_object_id`)
-) ENGINE=InnoDB;
\ No newline at end of file
+) ENGINE=InnoDB;
+
+-- using default 'unknown' to fill in the new column for compatibility
+ALTER TABLE `model_version_info` ADD COLUMN `model_version_uri_name` VARCHAR(256) NOT NULL DEFAULT 'unknown' COMMENT 'model version uri name';
+ALTER TABLE `model_version_info` DROP INDEX `uk_mid_ver_del`;
+ALTER TABLE `model_version_info` ADD CONSTRAINT `uk_mid_ver_uri_del` UNIQUE (`model_id`, `version`, `model_version_uri_name`, `deleted_at`);
+-- remove the default value for model_version_uri_name
+ALTER TABLE `model_version_info` ALTER COLUMN `model_version_uri_name` DROP DEFAULT;
Review Comment:
Would you please explain why do we need this "alter column"?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2176309713
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -477,7 +478,7 @@ private ModelVersionEntity updateModelVersionEntity(
.withModelIdentifier(entityModelIdentifier)
.withAliases(entityAliases)
.withComment(entityComment)
- .withUri(entityUri)
+ .withUris(ImmutableMap.of(ModelVersion.URI_NAME_UNKNOWN, entityUri))
Review Comment:
`URI_NAME_UNKNOWN` is used to be compatible with the usage of single URI, it's the reserved URI name.
`PROPERTY_DEFAULT_URI_NAME` is the property of model and model version, the value of the property indicates the default URI name of the model version.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7381] feat(model): Backend supports multiple URIs for model version [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2176251935
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/ModelVersionMetaService.java:
##########
@@ -321,26 +329,53 @@ public <E extends Entity & HasIdentifier> ModelVersionEntity updateModelVersion(
try {
SessionUtils.doMultipleWithCommit(
() ->
- updateResult.set(
+ updateResult.addAndGet(
SessionUtils.doWithoutCommitAndFetchResult(
ModelVersionMetaMapper.class,
mapper ->
mapper.updateModelVersionMeta(
POConverters.updateModelVersionPO(
- oldModelVersionPO, newModelVersionEntity),
- oldModelVersionPO))),
+ oldModelVersionPOs.get(0), newModelVersionEntity),
+ oldModelVersionPOs.get(0)))),
+ // TODO Only modifying the unknown URI is supported currently.
+ () ->
+ oldModelVersionPOs.stream()
+ .filter(
+ v ->
+ ModelVersion.URI_NAME_UNKNOWN.equals(v.getModelVersionUriName())
Review Comment:
The condition is quite complicated. Could you please provide a method with a meaningful name to replace it?
##########
catalogs/catalog-model/src/main/java/org/apache/gravitino/catalog/model/ModelCatalogOperations.java:
##########
@@ -477,7 +478,7 @@ private ModelVersionEntity updateModelVersionEntity(
.withModelIdentifier(entityModelIdentifier)
.withAliases(entityAliases)
.withComment(entityComment)
- .withUri(entityUri)
+ .withUris(ImmutableMap.of(ModelVersion.URI_NAME_UNKNOWN, entityUri))
Review Comment:
What's the difference between `URI_NAME_UNKNOWN` and `PROPERTY_DEFAULT_URI_NAME` in interface `ModelVersion`
##########
core/src/main/java/org/apache/gravitino/storage/relational/utils/POConverters.java:
##########
@@ -1474,21 +1484,31 @@ public static List<ModelVersionAliasRelPO> updateModelVersionAliasRelPO(
}
}
- public static ModelVersionPO initializeModelVersionPO(
- ModelVersionEntity modelVersionEntity, ModelVersionPO.Builder builder) {
+ public static List<ModelVersionPO> initializeModelVersionPO(
+ ModelVersionEntity modelVersionEntity, Long modelId) {
try {
- return builder
- // Note that version set here will not be used when inserting into database, it will
- // directly use the version from the query to avoid concurrent version conflict.
- .withModelVersion(modelVersionEntity.version())
- .withModelVersionComment(modelVersionEntity.comment())
- .withModelVersionUri(modelVersionEntity.uri())
- .withModelVersionProperties(
- JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.properties()))
- .withAuditInfo(
- JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.auditInfo()))
- .withDeletedAt(DEFAULT_DELETED_AT)
- .build();
+ String modelVersionProperties =
+ JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.properties());
+ String modelVersionAuditInfo =
+ JsonUtils.anyFieldMapper().writeValueAsString(modelVersionEntity.auditInfo());
+ return modelVersionEntity.uris().entrySet().stream()
+ .map(
+ entry ->
+ ModelVersionPO.builder()
+ .withModelId(modelId)
+ // Note that version set here will not be used when inserting into database,
+ // it will
+ // directly use the version from the query to avoid concurrent version
Review Comment:
please format the comment
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/h2/ModelVersionMetaH2Provider.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.storage.relational.mapper.provider.h2;
+
+import java.util.List;
+import org.apache.gravitino.storage.relational.mapper.ModelMetaMapper;
+import org.apache.gravitino.storage.relational.mapper.ModelVersionMetaMapper;
+import org.apache.gravitino.storage.relational.mapper.provider.base.ModelVersionMetaBaseSQLProvider;
+import org.apache.gravitino.storage.relational.po.ModelVersionPO;
+import org.apache.ibatis.annotations.Param;
+
+public class ModelVersionMetaH2Provider extends ModelVersionMetaBaseSQLProvider {
+
+ public String insertModelVersionMetas(
+ @Param("modelVersionMetas") List<ModelVersionPO> modelVersionPOs) {
+ return "<script>"
+ + "INSERT INTO "
+ + ModelVersionMetaMapper.TABLE_NAME
+ + "(metalake_id, catalog_id, schema_id, model_id, version, model_version_comment,"
+ + " model_version_properties, model_version_uri_name, model_version_uri, audit_info, deleted_at)"
+ + " SELECT m.metalake_id, m.catalog_id, m.schema_id, m.model_id, m.model_latest_version, v.model_version_comment,"
+ + " v.model_version_properties, v.model_version_uri_name, v.model_version_uri, v.audit_info, v.deleted_at"
+ + " FROM ("
+ + "<foreach collection='modelVersionMetas' item='version' separator='UNION ALL'>"
+ + " SELECT"
+ + " CAST(#{version.modelId} AS BIGINT) AS model_id, CAST(#{version.modelVersionComment} AS TEXT) AS model_version_comment,"
Review Comment:
Why do we need to `cast` here?
##########
core/src/main/java/org/apache/gravitino/meta/ModelVersionEntity.java:
##########
@@ -133,6 +134,13 @@ public Long id() {
throw new UnsupportedOperationException("Model version entity does not have an ID.");
}
+ @Override
+ public void validate() throws IllegalArgumentException {
+ Entity.super.validate();
+ Preconditions.checkArgument(
+ !uris.isEmpty(), "The uri of the model version entity must not be empty.");
Review Comment:
Will the `url` can't be null?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org