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



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -170,10 +191,15 @@ public void scan(Option<List<String>> keys) {
     HoodieTimeline completedInstantsTimeline = 
commitsTimeline.filterCompletedInstants();
     HoodieTimeline inflightInstantsTimeline = 
commitsTimeline.filterInflights();
     try {
-      // iterate over the paths
+
+      // Get the key field based on populate meta fields config
+      // and the table type
+      final String keyField = getKeyField();

Review comment:
       getKeyField() method is overridden by the derived class - 
HoodieMetadataMergedLogRecordReader. Making this keyField initialization at the 
constructor mean, the derived class constructor calling super() to this base 
class will inturn call the derived class method before it being fully 
constructed. Design wise we should not do that. Though it will work here as the 
derived class is returning only the string constant and not relying on any of 
its members. 




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