watermelon12138 commented on code in PR #9984:
URL: https://github.com/apache/hudi/pull/9984#discussion_r1384892385


##########
hudi-common/src/main/java/org/apache/hudi/common/util/InternalSchemaCache.java:
##########
@@ -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;

Review Comment:
   @xiarixiaoyao Hi, This problem is difficult to reproduce. I think that we 
can try to prevent it from the code perspective. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to