Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/3740#discussion_r22127758
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
@@ -1182,7 +1194,14 @@ abstract class RDD[T: ClassTag](
* Save this RDD as a compressed text file, using string representations
of elements.
*/
def saveAsTextFile(path: String, codec: Class[_ <: CompressionCodec]) {
- this.map(x => (NullWritable.get(), new Text(x.toString)))
+ // https://issues.apache.org/jira/browse/SPARK-2075
+ val nullWritableOrdering = new Ordering[NullWritable] {
+ override def compare(x: NullWritable, y: NullWritable): Int = 0
+ }
+ val nullWritableClassTag = implicitly[ClassTag[NullWritable]]
+ val textClassTag = implicitly[ClassTag[Text]]
+ val r = this.map(x => (NullWritable.get(), new Text(x.toString)))
--- End diff --
just noticed we can reuse the text array here to reduce gc. anyway that's
not part of this PR - would you be willing to submit a new PR for that?
---
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]