manojpec commented on a change in pull request #3968:
URL: https://github.com/apache/hudi/pull/3968#discussion_r752958425



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieMetadataMergedLogRecordReader.java
##########
@@ -76,6 +84,23 @@ protected void processNextDeletedKey(HoodieKey hoodieKey) {
     }
   }
 
+  @Override
+  protected HoodieRecord<?> createHoodieRecord(final IndexedRecord rec, final 
HoodieTableConfig hoodieTableConfig,
+                                               final String payloadClassFQN, 
final String preCombineField,
+                                               final boolean 
withOperationField,
+                                               final Option<Pair<String, 
String>> simpleKeyGenFields,
+                                               final Option<String> 
partitionName) {
+    if (hoodieTableConfig.populateMetaFields()) {
+      return super.createHoodieRecord(rec, hoodieTableConfig, payloadClassFQN, 
preCombineField, withOperationField,
+          simpleKeyGenFields, partitionName);
+    }
+
+    // When meta fields are not available, create the record using the
+    // preset key field and the known partition name
+    return SpillableMapUtils.convertToHoodieRecordPayload((GenericRecord) rec, 
payloadClassFQN,
+        preCombineField, simpleKeyGenFields.get(), withOperationField, 
partitionName);

Review comment:
       The parent class does this. When the virtual keys are enabled, 
simpleKeyGen fields are loaded from the table config. For the metadata table 
its always set to "key".
   
   ```
       // Key fields when populate meta fields is disabled (that is, virtual 
keys enabled)
       if (!tableConfig.populateMetaFields()) {
         this.populateMetaFields = false;
         this.simpleKeyGenFields = Option.of(
             Pair.of(tableConfig.getRecordKeyFieldProp(), 
tableConfig.getPartitionFieldProp()));
       }
   ```




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