Skip to content

Commit

Permalink
Make it in Java optional as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Apr 30, 2023
1 parent 7534304 commit 07e8839
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,12 @@ private static MetadataUpdate readUpgradeFormatVersion(JsonNode node) {
private static MetadataUpdate readAddSchema(JsonNode node) {
JsonNode schemaNode = JsonUtil.get(SCHEMA, node);
Schema schema = SchemaParser.fromJson(schemaNode);
int lastColumnId = JsonUtil.getInt(LAST_COLUMN_ID, node);
int lastColumnId;
if (node.has(LAST_COLUMN_ID)) {
lastColumnId = JsonUtil.getInt(LAST_COLUMN_ID, node);
} else {
lastColumnId = schema.highestFieldId();
}
return new MetadataUpdate.AddSchema(schema, lastColumnId);
}

Expand Down

0 comments on commit 07e8839

Please sign in to comment.