Skip to content

Commit

Permalink
Fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshj1703 committed Nov 21, 2023
1 parent 53efdb1 commit 3d48bfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static Schema resolveUnionSchema(Schema schema, String fieldSchemaFullNam
}

List<Schema> innerTypes = schema.getTypes();
if (innerTypes.size() == 2 && schema.isNullable()) {
if (innerTypes.size() == 2 && isNullable(schema)) {
// this is a basic nullable field so handle it more efficiently
return resolveNullableSchema(schema);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ private static void copyOldValueOrSetDefault(GenericRecord oldRecord, GenericRec
} else if (field.defaultVal() instanceof JsonProperties.Null) {
newRecord.put(field.pos(), null);
} else {
if (!field.schema().isNullable() && field.defaultVal() == null) {
if (!isNullable(field.schema()) && field.defaultVal() == null) {
throw new SchemaCompatibilityException("Field " + field.name() + " has no default value and is null in old record");
}
newRecord.put(field.pos(), field.defaultVal());
Expand Down

0 comments on commit 3d48bfc

Please sign in to comment.