Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/16739
  
    and actually I find the current behavior a bit hard to explain, could 
someone perhaps enlighten me if this is intentional and how best, if we are to, 
document this behavior?
    ```
     df <- as.DataFrame(cars, numPartitions = 5) <-- this set numSlices on RDD 
to 5
     +  expect_equal(getNumPartitions(df), 5)
     +  expect_equal(getNumPartitions(coalesce(df, 3)), 3)
     +  expect_equal(getNumPartitions(coalesce(df, 6)), 5)
     +
     +  df1 <- coalesce(df, 3)
     +  expect_equal(getNumPartitions(df1), 3)
     +  expect_equal(getNumPartitions(coalesce(df1, 6)), 5)  <---- even after a 
coalesce it can't go beyond 5 
     +  expect_equal(getNumPartitions(coalesce(df1, 4)), 4)
     +  expect_equal(getNumPartitions(coalesce(df1, 2)), 2)
     +
     +  df2 <- repartition(df1, 10)
     +  expect_equal(getNumPartitions(df2), 10) <-- right after repartition the 
number of partition is greater than the original numSlices
     +  expect_equal(getNumPartitions(coalesce(df2, 13)), 5) <-- but coalesce 
after repartition it can't go beyond 5
     +  expect_equal(getNumPartitions(coalesce(df2, 7)), 5)
     +  expect_equal(getNumPartitions(coalesce(df2, 3)), 3)
    ```


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