Created
August 11, 2021 08:39
-
-
Save thangarajan8/49a08a93b02ae05aaaf1e5aa3aadf2d6 to your computer and use it in GitHub Desktop.
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
| lines = sc.textFile('data.txt') #reading a text file | |
| lines_filtered = lines.filter(lambda line : ('word1' in line)) #filtering line contain the word "word1" | |
| lines_filtered.first() #took 1s to run | |
| lines_filtered.collect() #took 100s to run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment