zhangshenghang commented on code in PR #10102:
URL: https://github.com/apache/seatunnel/pull/10102#discussion_r2568615343
##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/PaimonSource.java:
##########
@@ -179,4 +182,32 @@ public SourceSplitEnumerator<PaimonSourceSplit,
PaimonSourceState> restoreEnumer
readBuilders,
1);
}
+
+ /** Infer parallelism based on Paimon data partition count. */
+ @Override
+ public int inferParallelism() {
+ int inferParallelism = 0;
+ try {
+ for (Map.Entry<String, ReadBuilder> entry :
readBuilders.entrySet()) {
+ String tableKey = entry.getKey();
+ ReadBuilder readBuilder = entry.getValue();
+ try {
+ List<PartitionEntry> partitionEntries =
+ readBuilder.newScan().listPartitionEntries();
+ inferParallelism += partitionEntries.size();
+ } catch (Exception e) {
+ log.warn(
+ "Failed to get partition info for table {},
skipping parallelism inference",
+ tableKey,
+ e);
+ return -1;
+ }
+ }
+
+ } catch (Exception e) {
+ log.warn("Failed to infer parallelism for Paimon source", e);
+ return -1;
+ }
+ return inferParallelism <= 0 ? 1 : inferParallelism;
+ }
Review Comment:
Is there a problem with this design? Is there any recommended calculation
rule for the parallelism of our Sink under normal circumstances? @Hisoka-X
--
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]