Fokko commented on code in PR #12211:
URL: https://github.com/apache/iceberg/pull/12211#discussion_r1950767278


##########
api/src/main/java/org/apache/iceberg/UpdateSchema.java:
##########
@@ -125,16 +185,23 @@ default UpdateSchema addColumn(String parent, String 
name, Type type) {
    * @param name name for the new column
    * @param type type for the new column
    * @param doc documentation string for the new column
+   * @param defaultValue a default value for the column in existing rows
    * @return this for method chaining
    * @throws IllegalArgumentException If parent doesn't identify a struct
    */
-  UpdateSchema addColumn(String parent, String name, Type type, String doc);
+  default UpdateSchema addColumn(
+      String parent, String name, Type type, String doc, Object defaultValue) {
+    throw new UnsupportedOperationException("Default values are not 
supported");
+  }
 
   /**
    * Add a new required top-level column.
    *
-   * <p>This is an incompatible change that can break reading older data. This 
method will result in
-   * an exception unless {@link #allowIncompatibleChanges()} has been called.
+   * <p>Adding a required column without a default is an incompatible change 
that can break reading
+   * older data. To make this a compatible change, add a default value by 
calling {@link

Review Comment:
   Adding a required column, without a default value, should affect writers. 
Because the field is missing the write operation will be rejected.



-- 
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-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to