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


##########
core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java:
##########
@@ -572,4 +1134,48 @@ private static PartitionSpec resolveSpec(
     throw new IllegalArgumentException(
         "Cannot find unpartitioned spec in specs: " + specsById.keySet());
   }
+
+  /**
+   * Projects the file's per-spec partition tuple into the target partition 
schema by field ID.
+   * Fields present in the target but not in the file's spec land as null.
+   */
+  private static StructProjection projectPartition(
+      ContentFile<?> file, Types.StructType partitionType) {
+    StructLike partition = file.partition();
+    Types.StructType sourceType;
+    if (partition instanceof PartitionData) {

Review Comment:
   I don't think this is going to be used so it probably doesn't matter, but 
Iceberg should almost never fail like this when it doesn't get an instance of a 
specific class when the API is an interface.
   
   The type this is attempting to recover is determined by the file's partition 
spec and should be recovered from `PartitionSpec#partitionType()`.



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