danny0405 commented on code in PR #8832:
URL: https://github.com/apache/hudi/pull/8832#discussion_r1215225367
##########
hudi-common/src/main/java/org/apache/hudi/common/util/CommitUtils.java:
##########
@@ -145,6 +145,15 @@ public static Set<Pair<String, String>>
getPartitionAndFileIdWithoutSuffix(Map<S
return partitionTofileId;
}
+ public static Set<Pair<String, String>>
flattenPartitionToReplaceFileIds(Map<String, List<String>>
partitionToReplaceFileIds) {
+ Set<Pair<String, String>> partitionTofileId = new HashSet<>();
+ // list all partitions paths
+ for (Map.Entry<String, List<String>> entry :
partitionToReplaceFileIds.entrySet()) {
+ entry.getValue().forEach(replaceFileId ->
partitionTofileId.add(Pair.of(entry.getKey(), replaceFileId)));
Review Comment:
Does this work for you:
```java
partitionToReplaceFileIds.entrySet()
.stream()
.flatMap(partitionFileIds ->
partitionFileIds.getValue().stream().map(replaceFileId ->
Pair.of(partitionFileIds.getKey(), replaceFileId)))
.collect(Collectors.toSet());
```
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstant.java:
##########
@@ -108,7 +107,7 @@ public enum State {
private final State state;
private final String action;
private final String timestamp;
- private final String stateTransitionTime;
+ private String stateTransitionTime;
Review Comment:
Revert this change.
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkRDDTableServiceClient.java:
##########
@@ -234,6 +235,11 @@ private void
completeClustering(HoodieReplaceCommitMetadata metadata,
this.txnManager.beginTransaction(Option.of(clusteringInstant),
Option.empty());
finalizeWrite(table, clusteringCommitTime, writeStats);
+ // Do conflict resolution checks for clustering if
SparkAllowUpdateStrategy is used.
+ // By using this UpdateStrategy implementation, Ingestion writers are
given preference over clustering re-writers.
+ if (this.config.getWriteConflictResolutionStrategy() instanceof
IngestionPrimaryWriterBasedConflictResolutionStrategy) {
Review Comment:
+1, and can we also fix the `HoodieFlinkTableServiceClient`
--
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]