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 2019/11/09 02:30:21 UTC

[GitHub] [incubator-iceberg] chenjunjiedada edited a comment on issue #619: Add schema validator

chenjunjiedada edited a comment on issue #619: Add schema validator
URL: https://github.com/apache/incubator-iceberg/pull/619#issuecomment-552055249
 
 
   @rdblue, sorry I forgot that this visitor is different from `IndexByName` visitor since it directly returns null in `list` and `map` function. That is because we don't push `filedNames` in case of `List` and `Map` when visiting the schema, so the `testMixedTypes` test fails if we apply validation in `IndexByName`.
   
   For example, when we define a mixed typed schema such as:
   ```java
       Schema schema = new Schema(
           required(1, "list_of_lists",
               ListType.ofOptional(2, ListType.ofOptional(3, StructType.of(
                   required(4, "id", LongType.get()))
               ))));
   ```
   It throws exception like: 
   `Invalid schema: multiple fields for name list_of_lists.element: 3 and 2
   org.apache.iceberg.exceptions.ValidationException: Invalid schema: multiple fields for name list_of_lists.element: 3 and 2
   `
   
   The map returned by `TypeUtil.indexByName` actually cannot express the concept of list of list.

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


With regards,
Apache Git Services

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