Skip to content

Commit

Permalink
[MINOR] Fix npe for get internal schema (#9984)
Browse files Browse the repository at this point in the history
  • Loading branch information
watermelon12138 authored Nov 14, 2023
1 parent 7667af6 commit 00ece7b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ public static InternalSchema getInternalSchemaByVersionId(long versionId, String
}
InternalSchema fileSchema = InternalSchemaUtils.searchSchema(versionId, SerDeHelper.parseSchemas(latestHistorySchema));
// step3:
return fileSchema.isEmptySchema() ? AvroInternalSchemaConverter.convert(HoodieAvroUtils.addMetadataFields(new Schema.Parser().parse(avroSchema))) : fileSchema;
return fileSchema.isEmptySchema()
? StringUtils.isNullOrEmpty(avroSchema)
? InternalSchema.getEmptyInternalSchema()
: AvroInternalSchemaConverter.convert(HoodieAvroUtils.addMetadataFields(new Schema.Parser().parse(avroSchema)))
: fileSchema;
}

public static InternalSchema getInternalSchemaByVersionId(long versionId, HoodieTableMetaClient metaClient) {
Expand Down

0 comments on commit 00ece7b

Please sign in to comment.