twuebi commented on code in PR #1665:
URL: https://github.com/apache/iceberg-go/pull/1665#discussion_r3750109438


##########
table/metadata_internal_test.go:
##########
@@ -711,6 +711,83 @@ func 
TestRejectStructurallyInvalidHistoricalPartitionSpec(t *testing.T) {
        assert.ErrorContains(t, err, "spec ID must be non-negative")
 }
 
+// A create-table request carries unbound placeholder IDs rather than final
+// field IDs. Spark numbers the root struct's fields by ordinal, so the first
+// column is field-id 0 and partitioning or sorting by it yields source-id 0.
+// NewMetadata must accept that and remap every source ID by name, matching
+// Java's TableMetadata.newTableMetadata.
+func TestNewMetadataFromOrdinalNumberedRequest(t *testing.T) {

Review Comment:
   Added `TestRejectZeroSourceIDInPersistedMetadata` covering v1/v2/v3 across 
default and historical specs and orders, plus 
`TestRejectZeroSourceIDInV1LegacyPartitionSpec` for the bare partition-spec 
field list, and the create-table test now re-parses the written metadata with 
the strict parser as the write-path check.



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