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


##########
partitions.go:
##########
@@ -291,6 +291,10 @@ func validateTransform(transform Transform) error {
                return t.validateNumBuckets()
        case *BucketTransform:
                return t.validateNumBuckets()
+       case TruncateTransform:

Review Comment:
   Partition specs now validate transform bounds eagerly here, but sort orders 
don't get the same treatment - `newSortOrder` in table/sorting.go only checks 
`Transform == nil` and `CanTransform`, not the numeric bounds. So a `SortField` 
with `TruncateTransform{Width: 0}` is accepted into an in-memory SortOrder and  
only fails later when the metadata is marshalled through the `MarshalText` 
backstop. It can't corrupt metadata, but it's a confusing late failure and an 
inconsistency with the partition path this PR tightens. Adding the same 
`validateWidth`/`validateNumBuckets` check in `newSortOrder` would make both 
paths fail  eagerly at construction.



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