shirshanka commented on a change in pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#discussion_r526531766
##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java
##########
@@ -781,11 +781,19 @@ public static Schema switchNamespace(Schema schema,
Map<String, String> namespac
for (Schema.Field oldField : schema.getFields()) {
Field newField = new Field(oldField.name(),
switchNamespace(oldField.schema(), namespaceOverride), oldField.doc(),
oldField.defaultValue(), oldField.order());
+ // Copy field level properties
+ for (Map.Entry<String, JsonNode> prop :
oldField.getJsonProps().entrySet()) {
+ newField.addProp(prop.getKey(), prop.getValue());
+ }
newFields.add(newField);
}
}
newSchema = Schema.createRecord(schema.getName(), schema.getDoc(),
newNamespace,
schema.isError());
+ // Copy schema level properties
Review comment:
Use the already defined copyProperties method?
----------------------------------------------------------------
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:
[email protected]