the-other-tim-brown commented on code in PR #575:
URL: https://github.com/apache/incubator-xtable/pull/575#discussion_r1826566377
##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaSchemaExtractor.java:
##########
@@ -144,12 +145,16 @@ private DataType convertFieldType(InternalField field) {
}
}
- private Metadata getMetaData(InternalType type) {
+ private Metadata getMetaData(InternalSchema schema) {
+ InternalType type = schema.getDataType();
+ MetadataBuilder metadataBuilder = new MetadataBuilder();
if (type == InternalType.UUID) {
- return new
MetadataBuilder().putString(InternalSchema.XTABLE_LOGICAL_TYPE, "uuid").build();
- } else {
- return Metadata.empty();
+ metadataBuilder.putString(InternalSchema.XTABLE_LOGICAL_TYPE, "uuid");
}
+ if (schema.getComment() != null) {
+ metadataBuilder.putString(COMMENT, schema.getComment());
+ }
+ return metadataBuilder.build();
}
public InternalSchema toInternalSchema(StructType structType) {
Review Comment:
Can the Map keys/values or the array values have comments on the field? if
so, it does not look like they are being extracted read into the InternalSchema
representation currently
--
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]