nsivabalan commented on a change in pull request #1004: [HUDI-328] Adding 
delete api to HoodieWriteClient
URL: https://github.com/apache/incubator-hudi/pull/1004#discussion_r347077742
 
 

 ##########
 File path: hudi-client/src/main/java/org/apache/hudi/HoodieWriteClient.java
 ##########
 @@ -1182,6 +1190,27 @@ private HoodieTable getTableAndInitCtx() {
     return table;
   }
 
+  /**
+   * Adds schema to config since deletes may not have schema set in the config.
+   */
+  private void addSchemaToConfig(HoodieTableMetaClient metaClient) {
+    try {
+      HoodieActiveTimeline activeTimeline = metaClient.getActiveTimeline();
+      Option<HoodieInstant> lastInstant =
+          
activeTimeline.getCommitsTimeline().filterCompletedInstants().lastInstant();
+      if (lastInstant.isPresent()) {
+        HoodieCommitMetadata commitMetadata = HoodieCommitMetadata.fromBytes(
+            activeTimeline.getInstantDetails(lastInstant.get()).get(), 
HoodieCommitMetadata.class);
+        if 
(commitMetadata.getExtraMetadata().containsKey(HoodieCommitMetadata.SCHEMA_KEY))
 {
+          
config.setSchema(commitMetadata.getExtraMetadata().get(HoodieCommitMetadata.SCHEMA_KEY));
 
 Review comment:
   @bvaradar : I just exposed a setSchema() to HoodieWriteConfig. If there is 
any other neat way to achieve this, let me know. 

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


With regards,
Apache Git Services

Reply via email to