danny0405 commented on code in PR #11470:
URL: https://github.com/apache/hudi/pull/11470#discussion_r1645249120


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/data/HoodieJavaRDD.java:
##########
@@ -120,6 +123,26 @@ public int getNumPartitions() {
     return rddData.getNumPartitions();
   }
 
+  @Override
+  public int deduceNumPartitions() {
+    // for source rdd, the partitioner is None
+    final Optional<Partitioner> partitioner = rddData.partitioner();
+    if (partitioner.isPresent()) {
+      int partPartitions = partitioner.get().numPartitions();
+      if (partPartitions > 0) {
+        return partPartitions;
+      }
+    }
+
+    if (SQLConf.get().contains(SQLConf.SHUFFLE_PARTITIONS().key())) {
+      return SQLConf.get().defaultNumShufflePartitions();
+    } else if (rddData.context().conf().contains("spark.default.parallelism")) 
{

Review Comment:
   The Java context may never has this config option right?



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