Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/15039#discussion_r78274176
--- Diff: core/src/main/scala/org/apache/spark/Partitioner.scala ---
@@ -55,14 +55,15 @@ object Partitioner {
* We use two method parameters (rdd, others) to enforce callers passing
at least 1 RDD.
*/
def defaultPartitioner(rdd: RDD[_], others: RDD[_]*): Partitioner = {
- val bySize = (Seq(rdd) ++ others).sortBy(_.partitions.length).reverse
- for (r <- bySize if r.partitioner.isDefined &&
r.partitioner.get.numPartitions > 0) {
- return r.partitioner.get
+ val rdds = Seq(rdd) ++ others
+ val filteredRdds = rdds.filter( _.partitioner.exists(_.numPartitions >
0 ))
--- End diff --
This doesn't match the code I posted in minor ways. There should be no
extra spaces around operators; there should be a space after 'if'; this uses
`return` unnecessarily. This is a lot of time spent on a trivial change, so I'd
appreciate it if you read the guidance on things like style, and read feedback
carefully if you're pursuing this. Or else close this.
---
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]