zeroshade commented on code in PR #1417:
URL: https://github.com/apache/iceberg-go/pull/1417#discussion_r3553759118


##########
table/metadata_schema_compatibility.go:
##########
@@ -47,7 +47,12 @@ func (e ErrIncompatibleSchema) Error() string {
                                        fmt.Fprintf(&problems, "\n- invalid 
write default for %s: %s columns must default to null", f.ColName, f.Field.Type)
                                }
                        } else {
-                               fmt.Fprintf(&problems, "\n- invalid initial 
default for %s: non-null default (%v) is not supported until v%d", f.ColName, 
f.Field.InitialDefault, f.InvalidDefault.MinFormatVersion)
+                               if f.Field.InitialDefault != nil {
+                                       fmt.Fprintf(&problems, "\n- invalid 
initial default for %s: non-null default (%v) is not supported until v%d", 
f.ColName, f.Field.InitialDefault, f.InvalidDefault.MinFormatVersion)
+                               }
+                               if f.Field.WriteDefault != nil {

Review Comment:
   nit: now that the `WriteDefault: field.InitialDefault` initializer is 
removed, the `InvalidDefault.WriteDefault` struct field is dead — it's never 
set, and the error text reads `f.Field.WriteDefault` directly. Worth removing 
that field. Also consider adding a test for the `InitialDefault`-only pre-v3 
case.



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