You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/21 20:25:26 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1336: Fix schema name conflicts

rdblue commented on a change in pull request #1336:
URL: https://github.com/apache/iceberg/pull/1336#discussion_r474938283



##########
File path: api/src/main/java/org/apache/iceberg/types/IndexByName.java
##########
@@ -128,9 +157,15 @@ private void addField(String name, int fieldId) {
     }
 
     Integer existingFieldId = nameToId.put(fullName, fieldId);
-    if (existingFieldId != null && !"element".equals(name) && !"value".equals(name)) {
-      throw new ValidationException(
-          "Invalid schema: multiple fields for name %s: %s and %s", fullName, existingFieldId, fieldId);
+    ValidationException.check(existingFieldId == null,
+        "Invalid schema: multiple fields for name %s: %s and %s", fullName, existingFieldId, fieldId);
+
+    // if the short name is not

Review comment:
       If this is a nested field. For top-level fields, the short name is the same as the canonical name.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org