lokeshj1703 commented on code in PR #12732:
URL: https://github.com/apache/hudi/pull/12732#discussion_r1933849216


##########
hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java:
##########
@@ -232,7 +232,7 @@ private Option<Schema> 
getTableSchemaFromLatestCommitMetadata(boolean includeMet
       String schemaStr = 
commitMetadata.getMetadata(HoodieCommitMetadata.SCHEMA_KEY);
       Schema schema = new Schema.Parser().parse(schemaStr);
       if (includeMetadataFields) {
-        schema = HoodieAvroUtils.addMetadataFields(schema, 
hasOperationField.get());
+        schema = HoodieAvroUtils.addMetadataFields(schema, 
schema.getField(HoodieRecord.OPERATION_METADATA_FIELD) != null);

Review Comment:
   Required only for test. Will remove this change.
   `hasOperationField` uses the latest data files to know whether operation 
field is present. The method fails for delete block since delete block is the 
latest data file but delete block does not store a schema.



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