nsivabalan commented on code in PR #13314:
URL: https://github.com/apache/hudi/pull/13314#discussion_r2094352972


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -346,10 +360,20 @@ public void close() throws IOException {
     }
   }
 
-  public HoodieFileGroupReaderIterator<T> getClosableIterator() {
+  public ClosableIterator<T> getClosableIterator() {
     return new HoodieFileGroupReaderIterator<>(this);
   }
 
+  /**
+   * @return An iterator over the records that wraps the engine-specific 
record in a HoodieRecord.
+   */
+  public ClosableIterator<HoodieRecord<T>> getClosableHoodieRecordIterator() {

Review Comment:
   Is there a test for this iterator? I don't see any usages in this patch. 
   can we add some sanity tests. 



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/BaseSparkInternalRowReaderContext.java:
##########
@@ -92,15 +92,16 @@ public Object getValue(InternalRow row, Schema schema, 
String fieldName) {
 
   @Override
   public HoodieRecord<InternalRow> 
constructHoodieRecord(BufferedRecord<InternalRow> bufferedRecord) {
+    HoodieKey hoodieKey = new HoodieKey(bufferedRecord.getRecordKey(), 
partitionPath);
     if (bufferedRecord.isDelete()) {
       return new HoodieEmptyRecord<>(
-          new HoodieKey(bufferedRecord.getRecordKey(), null),
+          hoodieKey,
           HoodieRecord.HoodieRecordType.SPARK);
     }
 
     Schema schema = getSchemaFromBufferRecord(bufferedRecord);
     InternalRow row = bufferedRecord.getRecord();
-    return new HoodieSparkRecord(row, 
HoodieInternalRowUtils.getCachedSchema(schema));
+    return new HoodieSparkRecord(hoodieKey, row, 
HoodieInternalRowUtils.getCachedSchema(schema), true);

Review Comment:
   the var name is slightly mis-leading.
   its somewhat referring to "avoidAnyMoreCopies".
   here we are setting it to true, so that anytime, if someone calls `copy()`, 
we return the same instance w/o making a copy. 
   
   



##########
hudi-common/src/main/java/org/apache/hudi/common/engine/HoodieReaderContext.java:
##########
@@ -129,6 +130,10 @@ public void setHasLogFiles(boolean hasLogFiles) {
     this.hasLogFiles = hasLogFiles;
   }
 
+  public void setPartitionPath(String partitionPath) {

Review Comment:
   I am yet to review your patch on adding virtual keys support to File group 
reader. 
   but I assume all these will work w/ virtual keys enabled as well. 



##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/TestFileGroupRecordBuffer.java:
##########
@@ -84,8 +84,6 @@ class TestFileGroupRecordBuffer {
   private final FileGroupReaderSchemaHandler schemaHandler =
       mock(FileGroupReaderSchemaHandler.class);
   private HoodieTableMetaClient hoodieTableMetaClient = 
mock(HoodieTableMetaClient.class);
-  private Option<String> partitionNameOverrideOpt = Option.empty();

Review Comment:
   same comment as above. 



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