caican00 commented on a change in pull request #35764:
URL: https://github.com/apache/spark/pull/35764#discussion_r826614621



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala
##########
@@ -111,6 +111,9 @@ class JDBCOptions(
   // the number of partitions
   val numPartitions = parameters.get(JDBC_NUM_PARTITIONS).map(_.toInt)
 
+  // the default number of partitions
+  val defaultNumPartitions = parameters.getOrElse(DEFAULT_NUM_PARTITIONS, 
"10").toInt

Review comment:
       > Same question here :) Do we really need a default? If the users want 
to have multiple partitions, shouldn't they specify this explicitly?
   
   @huaxingao 
   1. if users want to change partition nums, they only need to specify 
`DEFAULT_NUM_PARTITIONS` explicitly and do not need to specify any more 
parameters, jdbc will automatically calculate the upper and lower bounds of 
partitions using primary key
   2. If users do not specify any parameters, then we(jdbc) need a default 
value to determine the base number of partitions




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to