hudi-agent commented on code in PR #19137:
URL: https://github.com/apache/hudi/pull/19137#discussion_r3510462180


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/ttl/strategy/KeepByTimeStrategy.java:
##########
@@ -85,7 +85,7 @@ private Map<String, Option<String>> 
getLastCommitTimeForPartitions(List<String>
       log.info("Candidate partition paths list is empty, skip TTL stats 
collection");
       return Collections.emptyMap();
     }
-    int statsParallelism = Math.min(partitionPaths.size(), 200);
+    int statsParallelism = Math.min(partitionPaths.size(), 
writeConfig.getPartitionTTLStatsMaxParallelism());

Review Comment:
   🤖 Since this value is now user-configurable, what happens if someone sets it 
to 0 (or a negative value)? With a non-empty `partitionPaths`, `Math.min(size, 
0)` would hand a parallelism of 0 to `getContext().map(...)`, which the 
empty-input regression test above notes surfaces as `IllegalArgumentException: 
Positive number of partitions required` on the Spark path. Would it be worth 
guarding with something like `Math.max(1, configured)`, or validating the 
config to be >= 1?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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