beyond1920 commented on code in PR #10426:
URL: https://github.com/apache/hudi/pull/10426#discussion_r1438956162


##########
hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java:
##########
@@ -257,6 +259,8 @@ private Option<Schema> 
getTableSchemaFromCommitMetadata(HoodieInstant instant, b
       Schema schema = new Schema.Parser().parse(existingSchemaStr);
       if (includeMetadataFields) {
         schema = HoodieAvroUtils.addMetadataFields(schema, 
hasOperationField.get());
+      } else {
+        schema = HoodieAvroUtils.removeMetadataFields(schema);

Review Comment:
   After alter table schema like 
   `alter table t1 drop f_date`, `alter table t1 add f_long bigint`, the schema 
of alter schema instant would contain metadata fields.
   If not remove those metadata fields, the insert query would throw following 
exception
   ![Uploading image.png…]()
   



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