rdblue commented on a change in pull request #2496:
URL: https://github.com/apache/iceberg/pull/2496#discussion_r804922848
##########
File path: site/docs/spec.md
##########
@@ -159,6 +161,13 @@ A **`list`** is a collection of values with some element
type. The element field
A **`map`** is a collection of key-value pairs with a key type and a value
type. Both the key field and value field each have an integer id that is unique
in the table schema. Map keys are required and map values can be either
optional or required. Both map keys and map values may be any type, including
nested types.
+Iceberg supports default-value semantics for fields of nested types (i.e.,
struct, list and map). Specifically, a field
+of a nested type field can have a default value that will be returned upon
reading this field, if it is not manifested.
+The default value can be defined with both required and optional fields. Null
default values are allowed with optional
+fields only, and it's behavior is identical to optional fields with no default
value, that is a Null is returned upon
+reading this field when it is not manifested.
Review comment:
What are the rules for setting default values? The behavior required by
the SQL spec is that default values are handled as though they are written into
data files. That is, if I add an int field, x, with a default value of 0, write
a row, update the default value to 1, then the row that was written must have
x=0. I think that this implies that default values can't be changed unless we
know there are no data files without the default, but it would be good to get
more clarity here and some quotes from the SQL spec to inform this discussion.
--
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]