leesf commented on a change in pull request #1929:
URL: https://github.com/apache/hudi/pull/1929#discussion_r487128319
##########
File path:
hudi-client/src/main/java/org/apache/hudi/client/AbstractHoodieWriteClient.java
##########
@@ -117,7 +118,17 @@ public boolean commitStats(String instantTime,
List<HoodieWriteStat> stats, Opti
if (extraMetadata.isPresent()) {
extraMetadata.get().forEach(metadata::addMetadata);
}
- metadata.addMetadata(HoodieCommitMetadata.SCHEMA_KEY, config.getSchema());
+ String schema = config.getSchema();
+ if (config.updatePartialFields()) {
+ try {
+ TableSchemaResolver resolver = new
TableSchemaResolver(table.getMetaClient());
+ schema = resolver.getTableAvroSchemaWithoutMetadataFields().toString();
+ } catch (Exception e) {
+ // ignore exception.
+ schema = config.getSchema();
Review comment:
> We are potentially reducing schema here, so I think this can lead to
issues. Can we throw error? At the least, can you add a LOG here to make sure
this gets noticed?
it handles the case that users config update partial fields in the first
time, my original idea is not to throw error in this case, and LOG here sounds
reasonable to me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]