yyanyy commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r578065567
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadataParser.java
##########
@@ -262,7 +277,41 @@ static TableMetadata fromJson(FileIO io, InputFile file,
JsonNode node) {
lastSequenceNumber = TableMetadata.INITIAL_SEQUENCE_NUMBER;
}
int lastAssignedColumnId = JsonUtil.getInt(LAST_COLUMN_ID, node);
- Schema schema = SchemaParser.fromJson(node.get(SCHEMA));
+
+ List<Schema> schemas;
+ int currentSchemaId;
+ Schema schema = null;
Review comment:
This is because in the first if statement, after parsing the schema
array and assign the schema, I did a check to ensure the schema holding current
schema ID exists in schema array. Without this null check, the
`Preconditions.checkArgument(schema != null, ...)` will highlight with error
warning "schema variable might not be initialized".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]