Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 1.32 KB

TASKS.md

File metadata and controls

44 lines (35 loc) · 1.32 KB

D3A Hackathon: Unified Data Analytics with Apache Wayang

Example solutions to the tasks in this document can be found here.

WordCount

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.

Running WordCount with fixed input

mvn exec:java -Dexec.mainClass="org.apache.wayang.hackathon.WordCount"

Running WordCount with dynamic input

mvn exec:java -Dexec.mainClass="org.apache.wayang.hackathon.Main" -Dexec.args="java,spark file://$(pwd)/README.md"

FinanceQuery

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.

Writing to File

On an instantiated operator, call:

.writeTextFile("file:///tmp/out.txt", s => s.toString())