Apache Iceberg version
None
Query engine
None
Please describe the bug 🐞
TL;DR:
It's not always possible to set the DEFAULT value for newly written rows to NULL, without also altering what the DEFAULT value for existing rows should be.
Because of the backwards-compatibility of write-default, it will default to initial-default if it's not present.
To represent NULL, the default has to be omitted.
null seems to not be an accepted state for either initial-default or write-default.
The spec doesn't say they're nullable, and the iceberg-rest-fixture Catalog will return 500 if it reads a initial-default or write-default that is null
That means it's impossible to set the write-default to NULL, unless initial-default is also NULL (omitted)
Table to illustrate the problem:
┌──────────────────┬────────────────┬────────────────────┐
│ initial-default │ write-default │ result (new rows) │
├──────────────────┼────────────────┼────────────────────┤
│ 5 │ - │ 5 │
│ - │ 21 │ 21 │
│ 5 │ 21 │ 21 │
│ - │ - │ NULL │
└──────────────────┴────────────────┴────────────────────┘
write-default is omitted (-), but because initial-default is non-null, the result won't be NULL
Willingness to contribute
Apache Iceberg version
None
Query engine
None
Please describe the bug 🐞
TL;DR:
It's not always possible to set the DEFAULT value for newly written rows to NULL, without also altering what the DEFAULT value for existing rows should be.
Because of the backwards-compatibility of
write-default, it will default toinitial-defaultif it's not present.To represent
NULL, the default has to be omitted.nullseems to not be an accepted state for eitherinitial-defaultorwrite-default.The spec doesn't say they're nullable, and the iceberg-rest-fixture Catalog will return 500 if it reads a
initial-defaultorwrite-defaultthat isnullThat means it's impossible to set the
write-defaultto NULL, unlessinitial-defaultis also NULL (omitted)Table to illustrate the problem:
write-defaultis omitted (-), but becauseinitial-defaultis non-null, the result won't be NULLWillingness to contribute