1
0

[HUDI-1506] Fix wrong exception thrown in HoodieAvroUtils (#2405)

This commit is contained in:
wangxianghu
2021-01-06 19:49:17 +08:00
committed by GitHub
parent 698694a157
commit 47c5e518a7
2 changed files with 33 additions and 1 deletions

View File

@@ -428,10 +428,12 @@ public class HoodieAvroUtils {
if (returnNullIfNotFound) {
return null;
} else {
} else if (valueNode.getSchema().getField(parts[i]) == null) {
throw new HoodieException(
fieldName + "(Part -" + parts[i] + ") field not found in record. Acceptable fields were :"
+ valueNode.getSchema().getFields().stream().map(Field::name).collect(Collectors.toList()));
} else {
throw new HoodieException("The value of " + parts[i] + " can not be null");
}
}