rdblue commented on a change in pull request #1663:
URL: https://github.com/apache/iceberg/pull/1663#discussion_r523302084
##########
File path: core/src/main/java/org/apache/iceberg/avro/Avro.java
##########
@@ -300,23 +299,12 @@ public DeleteWriteBuilder equalityFieldIds(int...
fieldIds) {
meta("delete-type", "position");
- if (rowSchema != null && createWriterFunc != null) {
- // the appender uses the row schema wrapped with position fields
- appenderBuilder.schema(new org.apache.iceberg.Schema(
- MetadataColumns.DELETE_FILE_PATH,
- MetadataColumns.DELETE_FILE_POS,
- NestedField.optional(
- MetadataColumns.DELETE_FILE_ROW_FIELD_ID, "row",
rowSchema.asStruct(),
- MetadataColumns.DELETE_FILE_ROW_DOC)));
+ appenderBuilder.schema(DeletesUtil.posDeleteSchema(rowSchema));
Review comment:
This changes the logic so that it is incorrect. If a row will not be
written, then the schema should not include that row. The row may not be
written if either the `rowSchema` is not set, or if the `createWriterFunc` is
not set. But there are cases where the `rowSchema` is set and the other is not
because of the way callers use this API.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]