Revanth14 commented on issue #2062: URL: https://github.com/apache/iceberg-go/issues/2062#issuecomment-7171275045
#2655 is in, thanks all. for a follow-up on `UnmarshalJSON` and `*p = *other` rewriting types in place (including via the shared type `StructType.Field(i)` returns). That breaks the premise of the clone/`Ref` removal PR: any pointer to a schema-owned type can still be overwritten, so dropping the read clones isn't safe. Proposal: `NewSchema*` deep-copies its field types, the visitors walk a copy, reads keep cloning, and `FieldsRef` / `FindFieldByIDRef` / `PartitionSpec.FieldsRef` move behind an internal-only hook so they leave the public API. The alternative is the original plan (zero-copy reads, delete the clones and `Ref` accessors) plus a doc note not to overwrite types read from a schema. @nssalian @laskoviymishka @zeroshade which do you prefer? -- 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]
