romusz commented on PR #7710:
URL: https://github.com/apache/iceberg/pull/7710#issuecomment-1809358653

   Hi,
   
   Have you tested this refactoring with code generated for Go?
   What we get now is:
   ```go
   type TableRequirement struct {
        Type string `json:"type"`
   }
   ```
   
   and (for example)
   
   ```go
   type AssertTableUUID struct {
        TableRequirement
        Type string `json:"type"`
        Uuid string `json:"uuid"`
   }
   ```
   
   There are couple of problems with that:
   1. double storage of `Type`
   2. provided `[]TableRequirement{}` slice and the fact that 
`TableRequirement` is a struct not an interface, it cannot be "type switched" 
into it's "subtypes" (e.g. `AssertTableUUID`). 
   3. All previously-available, useful methods on `TableRequirement` have been 
nuked (e.g. `GetUuidOk` that allowed to extract TableUUID from 
`assert-table-uuid` requirement).
   
   In summary, Go generated code does not produce equivalent to what it's shown 
for Python.
   Please let me know if there is other way to traverse the requirements - so 
far it looks like a regression.
   
   
   
   


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