emilie-wang commented on code in PR #575:
URL: https://github.com/apache/incubator-xtable/pull/575#discussion_r1828219526
##########
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:
Good question, after checking the APIs, there is no comment can be added to
array value or map key/values level:
https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/types/StructType.html
The name of the test is confusing, actually we tested the nested struct
instead of array field:
https://github.com/apache/incubator-xtable/pull/575/files#diff-9328d59be408d684281f3d5b2b7a9ca9d9b030e8e7075cd741796eb85eb2642cR328
--
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]