Github user hotou commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4701#discussion_r25074390
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala ---
    @@ -64,8 +64,8 @@ class JdbcRDD[T: ClassTag](
         // bounds are inclusive, hence the + 1 here and - 1 on end
         val length = 1 + upperBound - lowerBound
         (0 until numPartitions).map(i => {
    -      val start = lowerBound + ((i * length) / numPartitions).toLong
    -      val end = lowerBound + (((i + 1) * length) / numPartitions).toLong - 
1
    +      val start = lowerBound + ((BigDecimal(i) * length) / 
numPartitions).toLong
    --- End diff --
    
    @srowen 
    
    1. BigInt in scala actually works, I should change to that. 
    2. The overflow is not necessary to be only the last partition, in my test 
case it was the last 4 partitions
    3. I think the current algo give us better partitions than the fix interval 
algo, for the reason in above comment, would you agree with that ?
    4. The current algo does +1 on the length and -1 on the end of each 
interval, I think that works fine. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to