jwtryg commented on code in PR #146:
URL: https://github.com/apache/iceberg-go/pull/146#discussion_r1890805188
##########
table/metadata.go:
##########
@@ -370,26 +928,34 @@ func (c *commonMetadata) validate() error {
func (c *commonMetadata) Version() int { return c.FormatVersion }
-type MetadataV1 struct {
- Schema iceberg.Schema `json:"schema"`
+type metadataV1 struct {
+ Schema *iceberg.Schema `json:"schema"`
Partition []iceberg.PartitionField `json:"partition-spec"`
commonMetadata
}
-func (m *MetadataV1) Equals(other Metadata) bool {
- rhs, ok := other.(*MetadataV1)
+func (m *metadataV1) Equals(other Metadata) bool {
+ rhs, ok := other.(*metadataV1)
if !ok {
return false
}
- return m.Schema.Equals(&rhs.Schema) && slices.Equal(m.Partition,
rhs.Partition) &&
+ if m == rhs {
+ return true
+ }
+
+ if m == nil || rhs == nil {
+ return false
+ }
Review Comment:
My apologies, you are right - this should never happen. I somehow missed
this one (and the next comment) when I was cleaning up after my nil-checking
frenzy.
I have removed the check.
--
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]