rdblue commented on code in PR #17000:
URL: https://github.com/apache/iceberg/pull/17000#discussion_r3502352506


##########
core/src/test/java/org/apache/iceberg/TestTrackedFileStruct.java:
##########
@@ -161,9 +158,7 @@ void projectionWithoutPartition() {
 
     TrackedFileStruct file = new TrackedFileStruct(projection);
     assertThat(file.size()).isEqualTo(2);
-    // should return EMPTY_PARTITION_DATA
-    assertThat(file.partition()).isNotNull();
-    assertThat(file.partition().size()).isEqualTo(0);
+    assertThat(file.partition()).isNull();

Review Comment:
   This is okay, but callers should not access fields that have not been 
projected and we make no guarantees about it when they do. In many cases, we 
fail if possible like when accessing `DataFile.recordCount()` without 
projecting, which results in a `NullPointerException` because `recordCount()` 
returns a primitive `long`.



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

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to