Last active
November 15, 2018 15:24
-
-
Save MehdiTAZI/7450583e29befe25a981cecbec09f2e6 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
| #!/bin/sh | |
| exec scala "$0" "$@" | |
| !# | |
| object HelloWorld { | |
| def main(args: Array[String]) { | |
| println("Hello, world! " + args.toList) | |
| } | |
| } | |
| HelloWorld.main(args) | |
| scala> val words = sc.textFile("adl://engiedatalake.azuredatalakestore.net/out/wordcount.txt") | |
| scala> val counts = words .flatMap(line => line.split(" ")).map(word => (word, 1)).reduceByKey(_ + _) | |
| scala> counts.saveAsTextFile("adl://engiedatalake.azuredatalakestore.net/out/wordcount-result.txt") |
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
| echo "this line is composed of 7 characters" > wordcount.txt | |
| echo "this one of 4 5" >> wordcount.txt | |
| echo "with this one of 16 characters it makes a full file of a total of 28" >> wordcount.txt | |
| hdfs dfs -put wordcount.txt adl://engiedatalake.azuredatalakestore.net/out/wordcount.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment