Akash3121 commented on code in PR #942:
URL: https://github.com/apache/incubator-xtable/pull/942#discussion_r4209066017
##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaSchemaExtractor.java:
##########
@@ -84,25 +84,19 @@ private static Integer nestedFieldId(Metadata nestedIds,
String path) {
return (int) nestedIds.getLong(path);
}
- public InternalSchema toInternalSchema(StructType structType) {
- return toInternalSchema(structType, null, false, null, null, null, null);
+ private static Integer nestedFieldId(
+ Metadata nestedIds, String nestedIdPath, String parquetChildName, String
internalChildName) {
+ Integer fieldId = nestedFieldId(nestedIds, childIdPath(nestedIdPath,
parquetChildName));
+ if (fieldId != null || parquetChildName.equals(internalChildName)) {
+ return fieldId;
+ }
+ return nestedFieldId(nestedIds, childIdPath(nestedIdPath,
internalChildName));
}
- private InternalSchema toInternalSchema(
- DataType dataType,
- String parentPath,
- boolean nullable,
- String comment,
- Metadata originalMetadata) {
- return toInternalSchema(dataType, parentPath, nullable, comment,
originalMetadata, null, null);
+ public InternalSchema toInternalSchema(StructType structType) {
+ return toInternalSchema(structType, null, false, null, null, null, null);
}
- /**
- * @param nestedIds the {@code delta.columnMapping.nested.ids} metadata of
the enclosing struct
- * field, or null when the field carries none
- * @param nestedIdPath the path of the current type within that metadata,
starting at the
- * enclosing field's physical name
- */
private InternalSchema toInternalSchema(
Review Comment:
Good catch, this was not intentional - I restored it
--
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]