kevinjqliu commented on issue #1493:
URL: 
https://github.com/apache/iceberg-python/issues/1493#issuecomment-2596312706

   Interesting that its not available in the java implementation.
   
   > Do you think we need to raise an issue there as well?
   
   We can. I guess it hasn't been an issue over there. Most likely people are 
using the work around you described above.
   
   > Can I please also have a bit more clarification on what do you mean by 
"modify pending updates" in this example? Thanks!
   
   yes, so 
   ```
   with table.update_schema() as update:
       update.add_column("details", StructType())
       update.add_column(("details", "confirmed_by"), StringType(), "Name of 
the exchange")
   ```
   `UpdateSchema` appends the column to its own internal fields. 
https://github.com/apache/iceberg-python/blob/50c33aa0119d9e2478b3865d864ec23a7c45b1d7/pyiceberg/table/update/schema.py#L223-L228
   
   There's some logic to [lookup the 
parent](https://github.com/apache/iceberg-python/blob/50c33aa0119d9e2478b3865d864ec23a7c45b1d7/pyiceberg/table/update/schema.py#L184-L211),
 but its based on the current schema. This ignores the columns already added to 
`UpdateSchema`
   
   So the next `add_column` statement cannot find the parent `details` field, 
because its in `UpdateSchema's _adds` field and not in the table schema


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to