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


##########
table/metadata.go:
##########
@@ -215,6 +218,7 @@ func MetadataBuilderFromBase(metadata Metadata) 
(*MetadataBuilder, error) {
 func (b *MetadataBuilder) HasChanges() bool { return len(b.updates) > 0 }
 
 func (b *MetadataBuilder) CurrentSpec() iceberg.PartitionSpec {
+       // FIXME: this should return a pointer which can be nil to avoid out of 
bounds indexing / np derefs
        return b.specs[b.defaultSpecID]

Review Comment:
   Taking another look at this fn - b.specs is not a map and specs may get 
added and removed as we go, so it's very much possible to be in a state where 
SpecID = 1023 but b.specs has only length of 2



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