rdblue commented on a change in pull request #2984: URL: https://github.com/apache/iceberg/pull/2984#discussion_r716253835
########## File path: api/src/main/java/org/apache/iceberg/util/StructProjection.java ########## @@ -58,12 +58,32 @@ public static StructProjection create(Schema dataSchema, Schema projectedSchema) return new StructProjection(dataSchema.asStruct(), projectedSchema.asStruct()); } + /** + * Creates a projecting wrapper for {@link StructLike} rows. + * <p> + * This projection does not work with repeated types like lists and maps. + * + * @param structType type of rows wrapped by this projection + * @param projectedStructType result type of the projected rows + * @param projectMissingFieldsAsNulls a flag whether to project missing fields as nulls Review comment: You might consider renaming this to `allowMissing`. The original behavior is to fail if there is a field missing from the base type and this change really just allows that case and does the most reasonable thing -- it fills in null. But we don't necessarily want to guarantee that this will always fill in null. So I'd change the boolean to state that it allows missing fields rather than it fills in nulls. Also, I think it is better for APIs in general to hide boolean arguments. Since this is already a factory method, why not use a name that signals missing fields are allowed? Something like `create` and `createAllowMissing`? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org