You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/10 08:59:23 UTC

[GitHub] [hudi] rmahindra123 commented on a change in pull request #5002: [HUDI-3595] Fixing NULL schema provider for empty batch

rmahindra123 commented on a change in pull request #5002:
URL: https://github.com/apache/hudi/pull/5002#discussion_r823486933



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java
##########
@@ -84,7 +86,10 @@ public static HoodieCommitMetadata buildMetadata(List<HoodieWriteStat> writeStat
     if (extraMetadata.isPresent()) {
       extraMetadata.get().forEach(commitMetadata::addMetadata);
     }
-    commitMetadata.addMetadata(HoodieCommitMetadata.SCHEMA_KEY, schemaToStoreInCommit == null ? "" : schemaToStoreInCommit);
+    // NULL Schema should not be written to commit metadata
+    if (!(schemaToStoreInCommit != null && schemaToStoreInCommit.equals(NULL_SCHEMA_STR))) {

Review comment:
       Should we keep the behavior consistent? Always add the schema as empty string if ether the schema is null or its NULL_SCHEMA_STR?




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org