rdblue commented on a change in pull request #4301:
URL: https://github.com/apache/iceberg/pull/4301#discussion_r830641751
##########
File path: format/spec.md
##########
@@ -193,6 +193,13 @@ Notes:
For details on how to serialize a schema to JSON, see Appendix C.
+#### Default value
+
+Default value can be assigned to top-level columns or nested fields when they
are added to an Iceberg table as part of the schema evolution. The first time a
default value is added, this default value is used to read rows belonging to
the files that lack the column (i.e. the files were written before the column
is added), this default value will also be the default value for the column if
user later inserts new rows without specifying the column.
Review comment:
This section needs more detail. A spec needs to state how something is
tracked and requirements for working with the metadata. See the next section
for a good example: "Schemas may be evolved by ... Valid type promotions are
...".
To start, this should have a short overview that describes exactly what is
stored and how those are used. This is where you will introduce the
`initial-default` and `write-default` properties of a struct field and explain
what they are used for.
The spec also needs to clearly state all of the behavior requirements that
have been discussed in this PR.
Currently, this is confusing because it refers to a single default, doesn't
state how that default is stored, and allows the default to change. From a
user's perspective it is okay to think of the two default values as a single
default that changes, but that is too unclear for a specification. Instead,
this should end with a description of how the two values are used to maintain
SQL behavior.
--
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]