badalprasadsingh commented on code in PR #2576:
URL: https://github.com/apache/iceberg-go/pull/2576#discussion_r4565256051


##########
table/sorting.go:
##########
@@ -213,6 +217,9 @@ func (s *SortField) unmarshal(b []byte, binding 
orderBinding) error {
        if next.Transform, err = iceberg.ParseTransform(transformString); err 
!= nil {
                return err
        }
+       if err := validateSortTransformSources(next); err != nil {
+               return err
+       }

Review Comment:
   P1: tables go wrote with extra ids on a built-in transform, even in an old 
non-default order, no longer load, and CommitTable can't fix them with #2559 
keeps existing specs loadable
   
   better: could only NewSortOrder and UnboundSortOrder decode check, since 
metadata reads, MarshalJSON and CheckCompatibility all run on load or commit?



##########
table/sorting.go:
##########
@@ -271,6 +278,27 @@ func validateSortSourceIDs(ids []int, binding 
orderBinding) error {
        return nil
 }
 
+// validateSortTransformSources rejects multiple sources for Iceberg's known
+// single-argument transforms. Unknown transforms may accept multiple inputs,
+// so their source IDs must remain readable for v3 forward compatibility.
+func validateSortTransformSources(field SortField) error {

Review Comment:
   can you add a bullet under "Unreleased compatibility notes" in releases.md, 
like #2559's? NewSortOrder and create or add-sort-order payloads now reject 
extra source IDs for built-in transforms. If reads stay strict (1), also say 
these tables stop loading (iceberg-ava can't read them either) and how to 
repair them



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