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 2021/09/20 16:09:18 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3135: Data: Fix equality delete set save DATE/TIMESTAMP type of data throw IllegalStateException

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



##########
File path: data/src/main/java/org/apache/iceberg/data/DeleteFilter.java
##########
@@ -134,9 +134,13 @@ protected long pos(T record) {
 
       Iterable<CloseableIterable<Record>> deleteRecords = Iterables.transform(deletes,
           delete -> openDeletes(delete, deleteSchema));
-      StructLikeSet deleteSet = Deletes.toEqualitySet(
-          // copy the delete records because they will be held in a set
-          CloseableIterable.transform(CloseableIterable.concat(deleteRecords), Record::copy),
+
+      // copy the delete records because they will be held in a set
+      CloseableIterable<Record> records = CloseableIterable.transform(CloseableIterable.concat(deleteRecords),
+          Record::copy);
+
+      StructLikeSet deleteSet = Deletes.toEqualitySet(CloseableIterable.transform(records,
+          record -> new InternalRecordWrapper(deleteSchema.asStruct()).wrap(record)),

Review comment:
       We prefer line wrapping that keeps arguments to the same method aligned rather than aligning arguments to different levels. Here, the lambda to create an `InternalRecordWrapper` is an argument to `transform`, but it is aligned with `deleteSchema.asStruct()` that is an argument to the outer `toEqualitySet` call.
   
   Instead, can you add a newline for each argument to `toEqualitySet`? If the line with the lambda is too long, then you can also add a newline for it that it indented from the start of the line with `transform`, so it is clear that it is an argument to `transform` and not `toEqualitySet`.




-- 
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-unsubscribe@iceberg.apache.org

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