JoyJoyJo commented on code in PR #12765:
URL: https://github.com/apache/hudi/pull/12765#discussion_r1944156823


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/clustering/ClusteringPlanOperator.java:
##########
@@ -139,11 +139,13 @@ private void scheduleClustering(HoodieFlinkTable<?> 
table, long checkpointId) {
       
ClusteringUtils.transitionClusteringOrReplaceRequestedToInflight(clusteringInstant,
 Option.empty(), table.getActiveTimeline());
       table.getMetaClient().reloadActiveTimeline();
 
+      int operationIndex = 0;
       for (HoodieClusteringGroup clusteringGroup : 
clusteringPlan.getInputGroups()) {
         LOG.info("Execute clustering plan for instant {} as {} file slices", 
clusteringInstantTime, clusteringGroup.getSlices().size());
         output.collect(new StreamRecord<>(
-            new ClusteringPlanEvent(clusteringInstantTime, 
ClusteringGroupInfo.create(clusteringGroup), 
clusteringPlan.getStrategy().getStrategyParams())
+            new ClusteringPlanEvent(clusteringInstantTime, 
ClusteringGroupInfo.create(clusteringGroup), 
clusteringPlan.getStrategy().getStrategyParams(), operationIndex)

Review Comment:
   ```Java
   // the first instant takes the highest priority.
   Option<HoodieInstant> firstRequested = Option.fromJavaOptional(
       pendingClusteringInstantTimes.stream()
           .filter(instant -> instant.getState() == 
HoodieInstant.State.REQUESTED).findFirst());
   ```
   The `scheduleClustering` method in `ClusteringPlanOperator` only handles the 
first plan each time.



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