xushiyan commented on code in PR #6878:
URL: https://github.com/apache/hudi/pull/6878#discussion_r1002756379


##########
hudi-common/src/main/java/org/apache/hudi/common/data/HoodieListData.java:
##########
@@ -148,6 +148,11 @@ public <O> HoodieData<T> 
distinctWithKey(SerializableFunction<T, O> keyGetter, i
         .values();
   }
 
+  @Override
+  public int getNumPartitions() {
+    return 1;

Review Comment:
   to revert unneeded change



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/BaseSparkCommitActionExecutor.java:
##########
@@ -176,7 +177,10 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> 
execute(HoodieData<HoodieRec
     context.setJobStatus(this.getClass().getSimpleName(), "Doing partition and 
writing data: " + config.getTableName());
     HoodieData<WriteStatus> writeStatuses = 
mapPartitionsAsRDD(inputRecordsWithClusteringUpdate, partitioner);
     HoodieWriteMetadata<HoodieData<WriteStatus>> result = new 
HoodieWriteMetadata<>();
-    updateIndexAndCommitIfNeeded(writeStatuses, result);
+    // dereference rdd so that no double de-referencing can happen by mistake.
+    int numPartitions = Math.max(1, writeStatuses.getNumPartitions());

Review Comment:
   don't think we need to guard it by min 1. the API getNumPartitions() should 
guarantee meaningful return value.



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