Created
October 30, 2015 20:53
-
-
Save JoshRosen/3340bbd893ae48a6526b to your computer and use it in GitHub Desktop.
Caching RDD[String] via dataFrames (more efficient if file is highly compressible via dictionary encoding).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val fileToRead = "/path/to/my/file" | |
val df = sc.textFile(fileToRead).map(l => Tuple1(l)).toDF("line").cache | |
val rdd: RDD[String] = df.rdd.map(_.getString(0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment