the-other-tim-brown commented on code in PR #13976:
URL: https://github.com/apache/hudi/pull/13976#discussion_r2372892723
##########
hudi-common/src/main/java/org/apache/hudi/common/data/HoodieData.java:
##########
@@ -220,6 +220,15 @@ <O> HoodieData<O>
mapPartitions(SerializableFunction<Iterator<T>,
*/
HoodieData<T> repartition(int parallelism);
+ /**
+ * Coalesces underlying collection (if applicable) making sure new {@link
HoodieData} has
+ * exactly {@code parallelism} partitions or less.
+ *
+ * @param parallelism target number of partitions in the underlying
collection
+ * @return {@link HoodieData<T>} holding coalesced collection
+ */
+ HoodieData<T> coalesce(int parallelism);
Review Comment:
Should we combine this into the `repartition` path? Repartition can also be
used with less partitions int Spark. The recommendation in Spark is to use
`coalesce` if you are reducing the number of partitions so we could make the
`repartition` method in `HoodieData` smarter to make the call to repartition or
coalesce based on the current partitions count vs the desired count.
--
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]