chenjunjiedada commented on a change in pull request #619: Add schema validator
URL: https://github.com/apache/incubator-iceberg/pull/619#discussion_r346672008
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/Schema.java
 ##########
 @@ -54,10 +54,14 @@
   public Schema(List<NestedField> columns, Map<String, Integer> aliases) {
     this.struct = StructType.of(columns);
     this.aliasToId = aliases != null ? ImmutableBiMap.copyOf(aliases) : null;
+
+    // validate the schema through IndexByName visitor
+    TypeUtil.indexByName(struct);
 
 Review comment:
   Do you mean update scheme definition in unit tests by reassigning new IDs? 
For example, there is a constant field `SUPPORTED_PRIMITIVES` in 
`testMixedTypes` that is used by other nested fields, do we need to remove the 
constant and use raw definition with new IDs? Or do you mean to use 
`reassignIds` from TypeUtils?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to