nastra commented on code in PR #15175:
URL: https://github.com/apache/iceberg/pull/15175#discussion_r2883068070


##########
api/src/main/java/org/apache/iceberg/util/StructProjection.java:
##########
@@ -179,12 +180,21 @@ public int projectedFields() {
   }
 
   public StructProjection wrap(StructLike newStruct) {
+    return wrap(newStruct, null);
+  }
+
+  public StructProjection wrap(StructLike newStruct, String newDescription) {
     this.struct = newStruct;
+    this.description = newDescription;
     return this;
   }
 
+  public String description() {
+    return description;
+  }
+
   public StructProjection copyFor(StructLike newStruct) {
-    return new StructProjection(type, positionMap, 
nestedProjections).wrap(newStruct);
+    return new StructProjection(type, positionMap, 
nestedProjections).wrap(newStruct, description);

Review Comment:
   thinking more about this, I'm not sure that's the right approach going 
forward. Maybe it's better to implement toString and defer to the underlying 
`struct` in the toString implementation.
   
   ```
   @Override
     public String toString() {
       return null != struct ? struct.toString() : null;
     }
   ```
   
   that way we don't need any of the other changes and we can also make sure 
that this is properly handled not only for RewritePositionDeleteFilesAction but 
also for the action for rewriting data files



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