Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/3580#discussion_r21222327
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
@@ -47,6 +47,44 @@ import org.apache.spark.util.collection.OpenHashMap
import org.apache.spark.util.random.{BernoulliSampler, PoissonSampler,
BernoulliCellSampler,
SamplingUtils}
+
+object RDD {
+
+ // The following implicit functions were in SparkContext before 1.2 and
users had to
+ // `import SparkContext._` to enable them. Now we move them here to make
the compiler find
+ // them automatically. However, we still keep the old functions in
SparkContext for backward
+ // compatibility and forward to the following functions directly.
+
+ implicit def rddToPairRDDFunctions[K, V](rdd: RDD[(K, V)])
+ (implicit kt: ClassTag[K], vt: ClassTag[V], ord: Ordering[K] = null):
PairRDDFunctions[K, V] = {
+ new PairRDDFunctions(rdd)
+ }
+
+ implicit def rddToAsyncRDDActions[T: ClassTag](rdd: RDD[T]):
AsyncRDDActions[T] = {
+ new AsyncRDDActions(rdd)
+ }
+
+ implicit def rddToSequenceFileRDDFunctions[K <% Writable: ClassTag, V <%
Writable: ClassTag](
+ rdd: RDD[(K, V)]): SequenceFileRDDFunctions[K, V] = {
+ new SequenceFileRDDFunctions(rdd)
+ }
+
+ implicit def rddToOrderedRDDFunctions[K : Ordering : ClassTag, V:
ClassTag](rdd: RDD[(K, V)])
+ : OrderedRDDFunctions[K, V] = {
--- End diff --
should be `OrderedRDDFunctions[K, V, (K, V)]`
---
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]