mchades commented on code in PR #14139:
URL: https://github.com/apache/gravitino/pull/14139#discussion_r4384645415
##########
core/src/main/java/org/apache/gravitino/storage/relational/po/SemanticModelPO.java:
##########
@@ -111,8 +117,17 @@ public static SemanticModelEntity fromSemanticModelPO(
try {
SemanticModelVersionInfoPO versionPO =
semanticModelPO.getSemanticModelVersionInfoPO();
SemanticModelDefinitionDTO definitionDTO =
- JsonUtils.anyFieldMapper()
- .readValue(versionPO.semanticModelDefinition(),
SemanticModelDefinitionDTO.class);
+ SemanticModelDefinitionDTO.builder()
+ .withDatasets(
+ JsonUtils.anyFieldMapper().readValue(versionPO.datasets(),
DatasetDTO[].class))
+ .withRelationships(
+ deserializeOptionalField(versionPO.relationships(),
RelationshipDTO[].class))
+ .withMetrics(deserializeOptionalField(versionPO.metrics(),
MetricDTO[].class))
+ .withAiContext(deserializeOptionalField(versionPO.aiContext(),
AIContextDTO.class))
+ .withCustomExtensions(
+ deserializeOptionalField(
+ versionPO.customExtensions(),
CustomExtensionDTO[].class))
+ .build();
Review Comment:
Added the failing column name to deserialization errors for all five
definition fields, preserving the original cause. The corruption tests now
verify the column name; all 11 PO tests pass.
--
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]