You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "laskoviymishka (via GitHub)" <gi...@apache.org> on 2026/04/03 08:40:47 UTC
Re: [PR] feat(table): multi-arg transforms in partition and sort fields [iceberg-go]
laskoviymishka commented on code in PR #824:
URL: https://github.com/apache/iceberg-go/pull/824#discussion_r3032020334
##########
partitions.go:
##########
@@ -41,8 +41,13 @@ var UnpartitionedSpec = &PartitionSpec{id: 0}
// PartitionField represents how one partition value is derived from the
// source column by transformation.
type PartitionField struct {
- // SourceID is the source column id of the table's schema
+ // SourceID is the source column id of the table's schema.
+ // For multi-argument transforms, this is the first source column;
+ // use SourceIDs to get all source columns.
SourceID int `json:"source-id"`
+ // SourceIDs contains all source column ids for multi-argument transforms.
+ // For single-argument transforms this is nil and SourceID should be used.
+ SourceIDs []int `json:"-"`
Review Comment:
Done, worth to mention - SourceID was a public exported struct field on both PartitionField and SortField. Any external code doing:
```golang
// struct literal
iceberg.PartitionField{SourceID: 1, ...}
// direct field access
id := field.SourceID
will break. Now it's:
// struct literal
iceberg.PartitionField{SourceIDs: []int{1}, ...}
// method call
id := field.SourceID()
```
This hits two patterns:
1. Struct literals with SourceID: — compile error (unknown field)
2. Field reads like .SourceID — compiles but becomes a method value (func() int) instead of int, so any arithmetic/comparison/assignment breaks
this worth to note in next release notes
If you think that breaking change here is unwanted - give me a heads-up, i'll rollback this.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org