rdblue opened a new pull request, #12211: URL: https://github.com/apache/iceberg/pull/12211
This adds default value support to `UpdateSchema` and the implementation of it in core. The API has new methods that accept a default value: * `addColumn(String name, Type type, String doc, Object defaultValue)` * `addRequiredColumn(String name, Type type, String doc, Object defaultValue)` * `updateColumnDefault(String name, Object defaultValue)` * `updateColumn(String name, Type type, String doc, Object defaultValue)` The new methods always require supplying a doc string, which can be `null`. However, callers should not need to know to pass `null` when there is no doc string. Because the type of a default value is `Object`, adding additional method signatures that omit the doc string would conflict (for instance `addColumn("a", StringType.get(), "default or description?")`). To make the API easier to use without adding conflicting signatures or new method names, this updates the implementation to allow combining `addRequiredColumn` with `updateColumnDefault`. Previously, modifications to added columns were not supported, but adding support makes the API behave like a builder: ```java table.updateSchema() .addRequiredColumn("a", StringType.get()) .updateColumnDefault("a", "unknown") .commit(); ``` -- 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