voonhous commented on code in PR #17535:
URL: https://github.com/apache/hudi/pull/17535#discussion_r2608912351
##########
hudi-common/src/main/java/org/apache/hudi/common/table/PartitionPathParser.java:
##########
@@ -53,17 +51,17 @@ public Object[] getPartitionFieldVals(Option<String[]>
partitionFields,
private static Object[] getPartitionValues(String[] partitionFields,
String partitionPath,
- Schema schema) {
+ HoodieSchema schema) {
String[] parts = partitionPath.split("/");
int pathSegment = 0;
boolean hasDateField = false;
Object[] partitionValues = new Object[partitionFields.length];
for (int i = 0; i < partitionFields.length; i++) {
String partitionField = partitionFields[i];
- Schema.Field field = schema.getField(partitionField);
+ Option<HoodieSchemaField> fieldOpt = schema.getField(partitionField);
// if the field is not present in the schema, we assume it is a string
- Schema fieldSchema = field == null ? Schema.create(Schema.Type.STRING) :
getNonNullTypeFromUnion(field.schema());
- LogicalType logicalType = fieldSchema.getLogicalType();
+ HoodieSchema fieldSchema = fieldOpt.isEmpty() ?
HoodieSchema.create(HoodieSchemaType.STRING) :
HoodieSchemaUtils.getNonNullTypeFromUnion(fieldOpt.get().schema());
+ HoodieSchemaType logicalType = fieldSchema.getType();
Review Comment:
Done
--
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]