mchades commented on code in PR #14684:
URL: https://github.com/apache/gravitino/pull/14684#discussion_r4488338220


##########
core/src/main/java/org/apache/gravitino/catalog/SemanticModelDispatcher.java:
##########
@@ -126,37 +129,40 @@ SemanticModel createSemanticModel(
   default SemanticModel importOssieDocument(
       Namespace namespace,
       OssieDocument document,
-      Consumer<SemanticModelDefinition> sourceValidator) {
+      Function<SemanticModelDefinition, SemanticModelSourceUpdate> 
sourceValidator) {
     Objects.requireNonNull(sourceValidator, "sourceValidator must not be 
null");
     ParsedSemanticModel model = 
OssieDocumentConverter.importDocument(document);
-    sourceValidator.accept(model.definition());
+    SemanticModelSourceUpdate sourceUpdate = 
sourceValidator.apply(model.definition());
     return importSemanticModel(
         NameIdentifier.of(namespace, model.name()),
         model.comment(),
         model.definition(),
-        model.properties());
+        model.properties(),
+        sourceUpdate);
   }

Review Comment:
   Added `Preconditions.checkArgument` on the validator result with a clear 
error message. A regression test verifies that a null result fails before model 
writes and still emits the import failure event.



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