wangxianghu opened a new pull request, #19092:
URL: https://github.com/apache/hudi/pull/19092
…y when no candidate partitions exist
### Describe the issue this Pull Request addresses
`KeepByTimeStrategy#getLastCommitTimeForPartitions` computes the Spark
parallelism as `Math.min(partitionPaths.size(), 200)`. When the candidate
partition list is empty, the parallelism becomes `0` and is passed into
`HoodieEngineContext#map`, which eventually reaches
`ParallelCollectionRDD.slice` and fails with:
java.lang.IllegalArgumentException: Positive number of partitions required
at
org.apache.spark.rdd.ParallelCollectionRDD$.slice(ParallelCollectionRDD.scala:119)
...
at
org.apache.hudi.client.common.HoodieSparkEngineContext.map(HoodieSparkEngineContext.java:116)
at
org.apache.hudi.table.action.ttl.strategy.KeepByTimeStrategy.getLastCommitTimeForPartitions(KeepByTimeStrategy.java:88)
at
org.apache.hudi.table.action.ttl.strategy.KeepByTimeStrategy.getExpiredPartitionsForTimeStrategy(KeepByTimeStrategy.java:73)
This breaks partition-TTL runs on tables that currently have no
TTL-eligible partitions, where the expected behavior is a clean no-op.
### Summary and Changelog
add empty check
### Impact
none
### Risk Level
none
### Documentation Update
none
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Enough context is provided in the sections above
- [ ] Adequate tests were added if applicable
--
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]