yihua commented on code in PR #11175:
URL: https://github.com/apache/hudi/pull/11175#discussion_r1622904727


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/HoodieIncrSource.java:
##########
@@ -231,7 +243,15 @@ public Pair<Option<Dataset<Row>>, String> 
fetchNextBatch(Option<String> lastCkpt
     // Remove Hoodie meta columns except partition path from input source
     String[] colsToDrop = shouldDropMetaFields ? 
HoodieRecord.HOODIE_META_COLUMNS.stream().toArray(String[]::new) :
         HoodieRecord.HOODIE_META_COLUMNS.stream().filter(x -> 
!x.equals(HoodieRecord.PARTITION_PATH_METADATA_FIELD)).toArray(String[]::new);
-    final Dataset<Row> src = source.drop(colsToDrop);
+    Dataset<Row> src = source.drop(colsToDrop);
+    if (getLatestSourceProfile().isPresent()) {
+      src = coalesceOrRepartition(src, 
getLatestSourceProfile().get().getSourcePartitions());
+    }

Review Comment:
   Could `getLatestSourceProfile().map().orElse()` be used instead of 
reassigning the variable?



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