You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/02/19 01:32:26 UTC
[GitHub] [incubator-iceberg] rdblue commented on a change in pull request
#759: Update schema for field additions,
updates [e.g type widening] using an input schema
rdblue commented on a change in pull request #759: Update schema for field additions, updates [e.g type widening] using an input schema
URL: https://github.com/apache/incubator-iceberg/pull/759#discussion_r381031878
##########
File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
##########
@@ -260,6 +261,64 @@ public UpdateSchema updateColumnDoc(String name, String doc) {
return this;
}
+ @Override
+ public UpdateSchema updateSchema(Schema newSchema) {
+ TypeUtil.visit(newSchema, new ApplyUpdates(schema, this));
+ return this;
+ }
+
+ private static final Joiner DOT = Joiner.on(".");
+
+ private static class ApplyUpdates extends TypeUtil.SchemaVisitor<Void> {
+ private final Schema schema;
+ private final UpdateSchema updateSchema;
+ private final Map<String, Integer> indexByName;
+
+ private ApplyUpdates(Schema schema, UpdateSchema updateSchema) {
Review comment:
It would be nice to update the names to signal a bit better what's happening here. From the usage, it looks like the schema passed in here is the current table schema and the schema that is traversed is the updated schema. Maybe some Javadoc for this visitor class would help.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org