anoopj commented on code in PR #18108:
URL: https://github.com/apache/iceberg/pull/18108#discussion_r4158341841


##########
core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java:
##########
@@ -101,7 +101,8 @@ public int specId() {
 
     @Override
     public StructLike partition() {
-      return file().partition() != null ? file().partition() : 
PartitionData.EMPTY;
+      StructLike partition = file.partition();
+      return partition != null ? partition : PartitionData.EMPTY;

Review Comment:
   With the recent change we did to calculate most of the projection in the 
reader, the work done in `partition()` is fairly cheap. But calling it once and 
reusing the reference reads cleaner than evaluating the same method twice in 
the ternary. Happy to revert if you'd prefer to keep this method out of the 
diff entirely.



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