the-other-tim-brown commented on code in PR #796:
URL: https://github.com/apache/incubator-xtable/pull/796#discussion_r2796573441
##########
xtable-core/src/test/java/org/apache/xtable/avro/TestAvroSchemaConverter.java:
##########
@@ -889,4 +889,25 @@ public void testIcebergToAvroUUIDSupport() {
assertEquals(
internalSchema,
AvroSchemaConverter.getInstance().toInternalSchema(avroRepresentation));
}
+
+ @Test
+ public void testExtractFieldCommentsFromAvroDocOrProp() {
+ Schema avroRepresentation =
+ new Schema.Parser()
+ .parse(
+ "{\"type\":\"record\",\"name\":\"commentRecord\",\"fields\":["
+ + "{\"name\":\"withDoc\",\"type\":\"string\",\"doc\":\"doc
comment\"},"
+ +
"{\"name\":\"withProp\",\"type\":\"int\",\"comment\":\"prop comment\"}"
+ + "]}");
+
+ InternalSchema internalSchema =
+ AvroSchemaConverter.getInstance().toInternalSchema(avroRepresentation);
+
+ Map<String, InternalField> fieldsByName =
+ internalSchema.getFields().stream()
+ .collect(java.util.stream.Collectors.toMap(InternalField::getName,
f -> f));
Review Comment:
Use an import instead of the fully qualified path
--
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]