tanmayrauth commented on code in PR #1069:
URL: https://github.com/apache/iceberg-go/pull/1069#discussion_r3253679409
##########
table/metadata.go:
##########
@@ -1363,6 +1363,22 @@ var (
ErrPartitionSpecNotFound = errors.New("partition spec not found")
)
+type v3FieldCheck struct {
+ name string
+ present bool
+}
+
+func rejectV3OnlyFields(version int, checks ...v3FieldCheck) error {
+ for _, c := range checks {
+ if c.present {
+ return fmt.Errorf("%w: v3-only field '%s' present in
v%d metadata",
+ ErrInvalidMetadataFormatVersion, c.name,
version)
Review Comment:
Done. I changed rejectV3OnlyFields to collect all violations and report
them via errors.Join instead of returning on the first one. Added a test case
("reports all rejected fields") that verifies both next-row-id and
encryption-keys are mentioned in the error when both are present
simultaneously.
--
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]