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


##########
core/src/main/java/org/apache/gravitino/catalog/SemanticModelValidator.java:
##########
@@ -100,22 +116,53 @@ private static void validateSource(NameIdentifier source, 
String path) {
     }
   }
 
-  private static void validateFields(@Nullable Field[] fields, String path) {
+  private static Set<String> validateFields(@Nullable Field[] fields, String 
path) {
+    Set<String> fieldNames = new HashSet<>();
     if (fields == null) {
-      return;
+      return fieldNames;
     }
 
-    Map<String, String> fieldNames = new HashMap<>();
+    Map<String, String> uniqueNames = new HashMap<>();
     for (int index = 0; index < fields.length; index++) {
       String fieldPath = path + "[" + index + "]";
       Field field = fields[index];
       String namePath = fieldPath + ".name";
-      validateUniqueName(field.name(), namePath, "field", fieldNames);
+      // Key and relationship references resolve field names 
case-insensitively, so two
+      // declared names equal ignoring case would make every reference to them 
ambiguous.
+      validateUniqueName(normalizeFieldName(field.name()), namePath, "field", 
uniqueNames);
+      fieldNames.add(normalizeFieldName(field.name()));
+    }
+    return fieldNames;
+  }
+
+  private static void validateKeys(Dataset dataset, String path, Set<String> 
fieldNames) {

Review Comment:
   The feature is unreleased. Semantic Model support (API #12499, 
storage/dispatch #12831, REST endpoints) exists only on main targeting 
2.0.0-SNAPSHOT — it appears in no release tag or release branch, and the latest 
release is 1.3.1. So no released deployment can hold models written against 
source-column names, and there is no migration plan needed. Deployments built 
from unreleased main snapshots could have such definitions, but pre-release 
snapshots carry no upgrade guarantees.



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