trushev commented on code in PR #5830:
URL: https://github.com/apache/hudi/pull/5830#discussion_r927306341


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -279,7 +279,7 @@ private void saveInternalSchema(HoodieTable table, String 
instantTime, HoodieCom
     FileBasedInternalSchemaStorageManager schemasManager = new 
FileBasedInternalSchemaStorageManager(table.getMetaClient());
     if (!historySchemaStr.isEmpty() || 
Boolean.parseBoolean(config.getString(HoodieCommonConfig.RECONCILE_SCHEMA.key())))
 {
       InternalSchema internalSchema;
-      Schema avroSchema = HoodieAvroUtils.createHoodieWriteSchema(new 
Schema.Parser().parse(config.getSchema()));
+      Schema avroSchema = HoodieAvroUtils.addMetadataFields(new 
Schema.Parser().parse(config.getSchema()), 
config.allowOperationMetadataField());
       if (historySchemaStr.isEmpty()) {

Review Comment:
   1) Because `HoodieAvroUtils` from `hudi-common` while `HoodieWriteConfig` 
from `hudi-client-common` which depends on the former
   2) And workaround (1) using `HoodieConfig` instead of `HoodieWriteConfig` 
does not make sense because there is no `getSchema()` in `HoodieConfig`. There 
is no even `AVRO_SCHEMA_STRING` for 
`HoodieConfig.getString(AVRO_SCHEMA_STRING)`. I think raw string 
`hoodie.avro.schema` is an inappropriate approach



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