haizhou-zhao commented on a change in pull request #4120:
URL: https://github.com/apache/iceberg/pull/4120#discussion_r806295052
##########
File path: core/src/main/java/org/apache/iceberg/avro/AvroSchemaUtil.java
##########
@@ -357,6 +361,26 @@ static Schema copyRecord(Schema record, List<Schema.Field>
newFields, String new
return copy;
}
+ static Schema copyArray(Schema array, Schema elementSchema) {
+ Preconditions.checkArgument(array.getType() ==
org.apache.avro.Schema.Type.ARRAY,
+ "Cannot invoke copyArray on non array schema");
+ Schema copy = Schema.createArray(elementSchema);
+ for (Map.Entry<String, Object> prop : array.getObjectProps().entrySet()) {
+ copy.addProp(prop.getKey(), prop.getValue());
+ }
+ return copy;
+ }
+
+ static Schema copyMap(Schema map, Schema valueSchema) {
+ Preconditions.checkArgument(map.getType() ==
org.apache.avro.Schema.Type.MAP,
+ "Cannot invoke copyMap on non map schema");
Review comment:
Added
--
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]