Example solutions to the tasks in this document can be found here.
To ensure your instance of Apache Wayang is operational, try to compile and execute one of the WordCount examples. We provide two examples with fixed files as input and another example that computes the wordcount for any file you wish to give.
mvn exec:java -Dexec.mainClass="org.apache.wayang.hackathon.WordCount"
mvn exec:java -Dexec.mainClass="org.apache.wayang.hackathon.Main" -Dexec.args="java,spark file://$(pwd)/README.md"
Given a file of stock prices,
calculate the average value of each stock for the year 2022.
You can decide to either collect your results into a Collection by
invoking a CollectionSink
with .collect()
, or to use a FileSink
and write it to a .txt or .csv file.
On an instantiated operator, call:
.writeTextFile("file:///tmp/out.txt", s => s.toString())