tanmayrauth commented on code in PR #1397:
URL: https://github.com/apache/iceberg-go/pull/1397#discussion_r3525718908


##########
table/updates.go:
##########
@@ -772,6 +772,10 @@ func NewAddEncryptionKeyUpdate(key EncryptionKey) 
*addEncryptionKeyUpdate {
 }
 
 func (u *addEncryptionKeyUpdate) Apply(builder *MetadataBuilder) error {
+       if err := u.EncryptionKey.Validate(); err != nil {

Review Comment:
    This validate is redundant — Apply just delegates to AddEncryptionKey, 
which now validates the same key at metadata.go:1341. Might be worth dropping 
this one so there's a single source of truth. Minor side effect of keeping it: 
on a V2 table with an invalid key, Apply reports the "key-id" error first, 
whereas calling AddEncryptionKey directly reports the "format version 3" error 
first — both ErrInvalidArgument, so not a real problem, just slightly  
inconsistent ordering.



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