nssalian commented on code in PR #2655:
URL: https://github.com/apache/iceberg-go/pull/2655#discussion_r4649618335
##########
website/src/releases.md:
##########
@@ -64,7 +64,14 @@ Per-release notes (highlights, breaking changes,
contributors) are published on
- **`UpdateSchema` rejects deleting an identifier field.** `DeleteColumn` on
an identifier column used to succeed and quietly drop the column from the
table's identifier fields. Now `Apply` (and `Commit`) fails with `cannot delete
identifier field …`, as in Java. Deleting a struct that contains one already
failed, and now reports `cannot delete field … as it will delete nested
identifier field …`. To delete the column anyway, also call
`SetIdentifierField` with the identifier fields the schema should keep (for
example `SetIdentifierField([][]string{})` to clear them). This also stops a
new column that reuses a deleted identifier column's name from becoming the
identifier.
- **Schema JSON defaults preserve integer precision.** `long` defaults now
decode as `int64` instead of `float64`; non-integral, non-numeric, or
out-of-range values now fail to parse. Numeric literals inside object and list
defaults decode as `json.Number` rather than `float64`.
- **REST mutation keys can enable transport replay.** Namespace, table, view,
transaction and scan-cancellation mutations listed in the [REST catalog
documentation](./configuration.md) now carry fresh UUIDv7 `Idempotency-Key`
headers when `GET /v1/config` returns a non-null `idempotency-key-lifetime`.
Go's HTTP transport may replay certain failed requests on reused connections
with the same key; the advertised lifetime is not yet enforced. Scan plan and
task key handling is unchanged. When a lifetime is advertised, a default
`Idempotency-Key` configured via `WithHeaders` is dropped after `GET
/v1/config`.
-- **`StructType.Fields()` returns a copy.** Changing the returned slice no
longer changes the struct, matching `ListType.Fields()` and `MapType.Fields()`.
Build a new type with `NewStructType` instead. `NumFields()` and `Field(i)`
read fields without copying, and `NewListType` and `NewMapType` are the
constructors for the other nested types. The exported fields are unchanged for
now; they become unexported before v1.0.0 (see
[#2062](https://github.com/apache/iceberg-go/issues/2062)).
+- **`StructType.Fields()` returns a copy.** Changing the returned slice no
longer changes the struct, matching `ListType.Fields()` and `MapType.Fields()`.
Build a new type with `NewStructType` instead. `NumFields()` and `Field(i)`
read fields without copying, and `NewListType` and `NewMapType` are the
constructors for the other nested types. The struct's field list is no longer
exported; see the next note.
+- **Nested type fields are unexported.** `StructType`, `ListType` and
`MapType` can no longer be built with keyed struct literals, and their fields
can no longer be assigned (see
[#2062](https://github.com/apache/iceberg-go/issues/2062)). Build them with
`NewStructType`, `NewListType` and `NewMapType`, and to change one, build a new
value. Read them through methods named after the old fields:
+ - `StructType.FieldList` becomes `Fields()` (a copy), or `NumFields()` and
`Field(i)` to read without copying.
+ - `ListType.ElementID`, `Element` and `ElementRequired` become
`ElementID()`, `Element()` and `ElementRequired()`.
+ - `MapType.KeyID`, `KeyType`, `ValueID`, `ValueType` and `ValueRequired`
become `KeyID()`, `KeyType()`, `ValueID()`, `ValueType()` and `ValueRequired()`.
+ - `Schema.IdentifierFieldIDs` is unexported too and becomes
`IdentifierFieldIDs()`, which returns a copy. Set the IDs with
`NewSchemaWithIdentifiers`, which keeps its own copy of the slice it is given.
+
+ The JSON form of these types and of `Schema` is unchanged.
Review Comment:
nit: this holds for pointers and for `Schema`, but not for values. On main,
`json.Marshal(*iceberg.NewListType(2,
iceberg.PrimitiveTypes.String, true))` gives
`{"element-id":2,"element-required":true}`, and a `StructType` value has no
`"type"`, because `MarshalJSON` had a pointer receiver. With the value
receivers here they encode like pointers. Maybe: "Pointers and `Schema` encode
the same way; values of these types now encode like pointers instead of a
partial form."
--
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]