iceberg-kitten commented on code in PR #2591:
URL: https://github.com/apache/iceberg-go/pull/2591#discussion_r4578521050
##########
partitions.go:
##########
@@ -90,7 +90,20 @@ func (p *PartitionField) EscapedName() string {
return url.QueryEscape(p.Name)
}
+func validatePartitionFieldSourceCount(transform Transform, sourceIDs []int)
error {
+ if len(sourceIDs) > 1 && isBuiltInPartitionTransform(transform) {
+ return fmt.Errorf("%w: built-in partition transform %s requires
exactly one source ID, got %d",
+ ErrInvalidPartitionSpec, transform, len(sourceIDs))
+ }
+
+ return nil
+}
+
func (p PartitionField) MarshalJSON() ([]byte, error) {
+ if err := validatePartitionFieldSourceCount(p.Transform, p.SourceIDs);
err != nil {
+ return nil, err
+ }
Review Comment:
Thanks, I changed to a strict check to match Java’s parser.
--
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]